Class represents a local wait handle event that resets automatically when signaled , after releasing a single waiting thread 类表示一个本地等待处理事件,在释放了单个等待线程以后,该事件会在终止时自动重置。
The signal notifies a waiting thread that the state of the locked object has changed , and the owner of the lock is ready to release the lock 该信号通知等待线程锁定对象的状态已更改,并且锁的所有者准备释放该锁。
Event wait handles also referred to simply as events are wait handles that can be signaled in order to release one or more waiting threads 事件等待句柄(简称事件)就是可以通过发出相应的信号来释放一个或多个等待线程的等待句柄。
Set , but they automatically return to nonsignaled as soon as a waiting thread is notified that the event has become signaled 类的实例设置为signaled ,但在等待线程获悉该事件已变为signaled之后,这些实例立即自动返回nonsignaled状态。
Method is called . any number of waiting threads , or threads that wait on the event after it has been signaled , can be released while the object s state is signaled 在对象保持已发信号状态期间,可以释放任意数目的等待线程或在已发事件信号后仍等待事件的线程。
If a thread terminates normally while owning a mutex object , the state of the mutex object is set to signaled and the next waiting thread gets ownership 如果某个线程在拥有mutex对象时正常终止,则该mutex对象的状态将被设置为signaled ,并且下一个等待线程将获得所属权。
If you want the thread that signaled the event to begin a new task after all the waiting threads have resumed , you must block it until all the waiting threads have resumed 如果您要发出事件信号的线程在所有等待线程恢复执行之后开始新任务,则您必须阻止它,直到所有等待线程恢复执行为止。
Until an unblocked thread calls the set method , which releases one of the waiting threads in the case of automatic reset events or all of them in the case of manual reset events 方法时,此方法然后会释放其中的一个等待线程(如果是自动重置事件)或所有的等待线程(如果是手动重置事件) 。
When a lock is contended , not only does the jvm have to maintain a queue of waiting threads , but it must use system calls to block and unblock the threads that are not able to acquire the lock immediately 当一个锁处于争用状态下时, jvm不但要维护一个等待线程队列,而且还必须使用系统调用来阻塞和消除阻塞不能立即得到锁的线程。
The word " event " is used to describe them because they have traditionally been referred to as operating - system events , and because the act of signaling the wait handle indicates to waiting threads that an event has occurred 之所以用“事件”一词来描述它们,一是因为人们习惯上将它们称为操作系统事件,二是因为发出等待句柄信号的行为提示等待线程发生了一个事件。