TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
geo lam
NA
8
0
TryEnter always return true in Timer Event
May 12 2009 11:35 PM
Dear All, That's strange that when I use TryEnter in Timer event which triggers every 1 sec, the TryEnter() always returns true. Why there is such an error? public partial class Form1 : Form { private object BlockingObj = new object(); private void timer1_Tick(object sender, EventArgs e) { bool ret = System.Threading.Monitor.TryEnter(BlockingObj, 1); if (ret){ try { DialogResult result = MessageBox.Show("test", "", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); } finally { System.Threading.Monitor.Exit(BlockingObj); } } } }
Reply
Answers (
1
)
html output of textbox & insert formating text tools
Delete a record from data grid if check box is checked