Skip to content

Instantly share code, notes, and snippets.

@drub0y
Last active December 27, 2015 00:39
Show Gist options
  • Save drub0y/7239374 to your computer and use it in GitHub Desktop.
Save drub0y/7239374 to your computer and use it in GitHub Desktop.
This is a decompiled view of how the PowerShell provider (specifically it's TypeManager class) for IIS attempts to provide consistency btwn the execution of a command and the commits actually being written to disk in applicationHost.config. All kinds of fun ensues when committing the changes to disk doesn't actually happen within that one second…
public void CommitChanges(bool doCommit)
{
if (!this.InCommitDelay() && this.WritableServerManager != null)
{
try
{
if (doCommit)
{
this.commitSynchronization = new AutoResetEvent(false);
this.WritableServerManager.CommitChanges();
this.commitSynchronization.WaitOne(1000, false);
}
}
finally
{
this.commitSynchronization = null;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment