ContentsIndex
PreviousUpNext
Functions
Functions | Thread

The following table lists functions in this documentation.

Functions
Function 
Description 
Initializes a mutex. 
Locks a mutex, to block the access to the data (objects or variables) protected by the mutex. 
Releases the mutex. The thread that is blocked by the mutex will have the access to the protected objects by the mutex when the mutex is unlocked. 
The ID of the signal which was clean. 
Creates a signal for thread communication. 
Destroys a signal when it is no longer needed, so the resource is released. 
Posts a signal then all the threads, which are waiting for it, will be waken up. 
Waits on a signal. If the signal is not set, the thread will be blocked. When the other thread posts the signal, the waiting threads will be waken up. This API should be used in the threads spawned from vm_thread_create(). If the time out has been reached and the signal is posted yet, the waiting thread will resume the execution. 
Waits on a signal. If the signal is not set, the thread will be blocked. When the other thread posts the signal, the waiting threads will be waken up. This API should only be used in the threads spawned from vm_thread_create(). 
Creates a thread. Limited by the system, vm_thread_create() can only create up to 10 threads. The caller of this function needs to pass the expected priority to the create. The value 1 indicates the highest priority, while the 255 is the lowest. The actual thread priority will be assigned by the system according to the following rule.
 

  1. If the expected priority is equal or less than 128, the actual priority

assigned by the system will be higher than the main thread.

  1. If the expected priority is equal or greater than 129, the actual thread

priority assigned by the system will... more 

Gets the handle of the current thread. Note, this function is not supported in the main thread. 
Get the handle of the main. 
Reads the message from a message queue. This function will be blocked if the message queue is empty. It can only be used in a thread spawned from vm_thread_create(). 
Sends a message to a thread. 
Makes a thread sleep for a number of milliseconds. It should only be used in the threads spawned from vm_thread_create(). Note, putting a thread into the sleep for too long could potentially cause unexpected behavior. If the thread, which is responsible for reading from a message queue, was put into sleep for too long, for example, the message queue might overflow because of too many unprocessed messages. 
Module
Created with a commercial version of Doc-O-Matic. In order to make this message disappear you need to register this software. If you have problems registering this software please contact us at support@toolsfactory.com.