Jump to content
  • Advertisement
Sign in to follow this  

[.net] Monitor Warning

This topic is 4704 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Just FYI in 2.0 Monitor.Exit() calls are checked to ensure that the thread calling Exit owns the lock to begin with. I had a sinister little bug where I was locking a string variable and setting it to String.Empty in one part of my code. I was throwing exceptions in 2.0 but not 1.1 and it was becase String.Empty is of course a separate, static object. So in some cases I actually didn't own the lock on my String variable, even though just looking at the code made it seem like I did. Fixed the problem by using a separate empty Object for locking.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!