You should not lock the object you are about to use, create a lock object
that you can use for that instead.
private readonly object myLock = new object();
void DoThreadedStuff(){
lock(myLock){
//Anything that requires a lock here.
}
}
This will only lock the myLock
object, not the stream itself.