xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

Notify()

Resumes a single thread blocked by a particular Mutex.

Syntax

Notify( <pMutexHandle>, [<xValue>] ) --> NIL

Arguments

<pMutexHandle>
This is the handle of the Mutex to notify. It is the return value of HB_MutexCreate().
<xValue>
Optionally, an arbitrary value can be passed as second parameter. It defines the return value of Subscribe() and, thus, is passed to the thread that is blocked by the Mutex.

Return

The function returns always NIL.

Description

Function Notify() sends a notification to the next thread having subscribed to a Mutex. The second parameter <xValue> defines the return value for the function Subscribe() being executed in a second thread. If more than one thread have subscribed to the Mutex <pMutexHandle>, the operating system selects the thread to resume exexuting program code. It is not possible to notify a particular thread waiting for a Mutex.

Info

See also:GetCurrentThread(), GetThreadID(), HB_MutexCreate(), HB_MutexLock(), NotifyAll(), StartThread(), Subscribe(), SubscribeNow()
Category: Multi-threading functions , Mutex functions , xHarbour extensions
Source:vm\thread.c
LIB:xhbmt.lib
DLL:xhbmtdll.dll


Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe