Lines Matching refs:thread
47 #error "Thread is not defined!"
59 * Library for basic thread and monitor functionality to ensure portability.
62 * Every thread has a priority. Threads with higher priority are executed in preference
63 * to threads with lower priority. When code running in some thread creates a new Thread
64 * object, the new thread has its priority initially set equal to the priority of the creating
65 * thread.
82 * Blocks the current thread for the specified amount of time.
85 * equivalent to a thread yield.
92 * Creates a thread monitor. Thread monitors can be locked, unlocked, can be
94 * locking, meaning that a thread owning the monitor can call lock without
110 * @return ESR_SUCCESS if success; ESR_INVALID_STATE if this function is called after the thread
142 * thread does not hold the monitor.
147 * Causes current thread to wait until another thread invokes the
153 * The current thread must own this monitor. The thread releases ownership of
154 * this monitor and waits until another thread notifies threads waiting on
157 * <code>PtrdMonitorNotifyAll</code> method. The thread then waits until it
164 * thread does not hold the monitor.
170 * Causes current thread to wait until either another thread invokes the
182 * thread does not hold the monitor, or ESR_TIMED_OUT if the timeout expired
189 * Wakes up a single thread that is waiting on this monitor. If more than one
190 * thread are waiting on this object, one of them is arbitrarily chosen to be
191 * awakened. A thread waits on the monitor by calling
196 * The awakened thread will not be able to proceed until the current thread
197 * relinquishes the lock on this object. The awakened thread will compete in
199 * synchronize on this object; for example, the awakened thread enjoys no
200 * reliable privilege or disadvantage in being the next thread to lock this
205 * This method should only be called by a thread that is the owner of this
210 * thread does not hold the monitor, or ESR_TIMED_OUT if the timeout expired
216 * Wakes up all threads that are waiting on this monitor. A thread waits on
222 * The awakened threads will not be able to proceed until the current thread
226 * reliable privilege or disadvantage in being the next thread to lock this
231 * This method should only be called by a thread that is the owner of this
238 * thread does not hold the monitor.
243 * Creates a thread mutex. Thread mutexes are similar to thread monitors
247 * so-called recursive locking, meaning that a thread owning the mutex can
295 * thread does not hold the mutex.
301 * Creates a thread semaphore.
326 * current thread waits until the semaphore's value is greater than 0.
338 * current thread waits until the semaphore's value is greater than 0 or until
363 * Function signature invoked on the new thread by PtrdThreadCreate(), and
375 * Minimum thread priority.
380 * Maximum thread priority.
385 * Normal thread priority.
390 * Creates a thread.
392 * Execution starts on the thread immediately. To pause execution use a
393 * monitor or a mutex between the thread and the thread creator.
395 * @param thread Handle to the thread that is created
396 * @param startFunc Function for the thread to start execution on
397 * @param arg Argument to the thread function
399 * @return ESR_INVALID_ARGUMENT if thread or startFunc are null; ESR_OUT_OF_MEMORY if system is out of memory;
400 * ESR_THREAD_CREATION_ERROR if thread cannot be created
403 PtrdThread** thread);
406 * Destroys a thread handle.
408 * Note: this does NOT stop or destroy the thread, it just releases
410 * occurs, so if the creator of the thread never needs to communicate
411 * with the thread again it should call this immediately after the
417 PORTABLE_API ESR_ReturnCode PtrdThreadDestroy(PtrdThread *thread);
420 * Wait for the termination of a specified thread
422 * @param thread Handle to the thread to wait for
424 * @return ESR_INVALID_ARGUMENT if thread is null
426 PORTABLE_API ESR_ReturnCode PtrdThreadJoin(PtrdThread *thread);
429 * Returns the thread priority.
431 * @param thread PtrdThread handle
432 * @param value [out] Thread priority
434 * @return ESR_INVALID_ARGUMENT if thread or value are null; ESR_INVALID_STATE if thread priority cannot be
437 PORTABLE_API ESR_ReturnCode PtrdThreadGetPriority(PtrdThread *thread, asr_uint16_t* value);
440 * Sets the thread priority.
442 * @param thread PtrdThread handle
443 * @param value Thread priority
445 * @return ESR_INVALID_ARGUMENT if thread or value are null; ESR_INVALID_STATE if thread priority cannot be
448 PORTABLE_API ESR_ReturnCode PtrdThreadSetPriority(PtrdThread *thread, asr_uint16_t value);
451 * Yields execution of the current thread to other threads.
458 * Initializes the thread library. This should be called before creating the
459 * first thread or the first monitor.
467 * Indicates if thread library has been initialized.
475 * Shutdowns the thread library. All thread and monitor should be terminated