使用WaitHandle
来源:互联网 发布:淘宝6.6.0 编辑:程序博客网 时间:2024/05/29 03:53
1.使用WaitHandle 等待句柄应当是你进行多线程编程的必备装备。由于我们的主要兴趣点在于Silverlight多线程编程相关的内容,所以我们不想再深入探讨WaitHandle。但在此为你提供一个典型的例子,告诉你使用WaitHandle的基本方法。 清单1: public partial class MainPage : UserControl
{
AutoResetEvent handle = new AutoResetEvent(true);
public MainPage()
{
InitializeComponent();
new Thread(() =>
{
while (true)
{
handle.WaitOne();
this.Dispatcher.BeginInvoke(() =>
{
this.TextBlock1.Text = DateTime.Now.ToString();
});
}
}).Start();
}
private void Button_Click(object sender, RoutedEventArgs e)
{
handle.Set();
}
}
- 使用WaitHandle
- WaitHandle 的使用.
- 使用WaitHandle和其他
- C# WaitHandle 使用教程
- WaitHandle
- WaitHandle——使用Mutex
- WaitHandle——使用ManualResetEvent
- WaitHandle——使用Semaphore
- WaitHandle——使用AutoResetEvent
- system.threading WaitHandle
- WaitHandle.WaitOne 方法
- WaitHandle、AutoResetEvent、ManualResetEvent整理
- WaitHandle 类 备忘
- WaitHandle.WaitOne 方法 ()
- 多线程异步编程(1):创建多个线程执行任务,同时更新进度条,使用WaitHandle发送信号
- c# 多线程-异步-WaitHandle-AutoResetEvent
- C# ThreadPool and WaitHandle Sample
- c# 多线程-异步-WaitHandle-AutoResetEvent
- 图标问题
- 图标问题
- 汉澳现代战争军事指挥作战系统 v1.7
- 我的首份文章
- cin、cin.get()、cin.getline()、getline()、gets()函数的用法
- 使用WaitHandle
- 比较全面的gdb调试命令
- USACO 3.4.1 closed fence
- MySQL使用集锦
- Android,谁动了我的内存
- 敏捷实施笔记:第1章 沟通
- 使用定时器
- ping 命令详解。
- Swing设置窗体最大化