S60 Open C
libpthread API Specification

libpthread API Specification

Table of Contents

API Description
API Categories
libpthread Functions
Pseudo Functions

 


API Description

This page lists the different categories in the libpthread library.

 


API Categories

 


libpthread Functions

Basic Thread Operations

Function

Description

pthread_create Creates a new thread, with attributes specified by attrib, within a process.
pthread_exit Terminates the calling thread and makes the value retValPtr available to any successful join with the terminating thread.
pthread_join Suspends execution of the calling thread until the target thrHandle terminates unless the target thrHandle has already terminated.

Condition Variables

Function

Description

pthread_cond_broadcast Unblocks all threads waiting for the condition variable cond.
pthread_cond_destroy Frees the resources allocated by the condition variable cond.
pthread_cond_init Creates a new condition variable.
pthread_cond_signal Unblocks one thread waiting for the condition variable cond.
pthread_cond_timedwait Atomically blocks the current thread waiting on the condition variable specified by cond, and unblocks the mutex specified by mutex.
pthread_cond_wait Atomically blocks the current thread waiting on the condition variable specified by cond, and unblocks the mutex specified by mutex.

Miscellaneous Thread Functions

Function

Description

pthread_equal Compares the thread IDs t1 and t2.
pthread_detach Indicates to the implementation, that storage for the thread thrHandle can be reclaimed when the thread terminates.
pthread_once Calls the init_routine with no arguments
pthread_self Returns the thread ID of the calling thread.

Mutexes

Function

Description

pthread_mutex_destroy Frees the resources allocated for mutex.
pthread_mutex_init Creates a new mutex, with attributes specified with attr.
pthread_mutex_lock Locks mutex. If the mutex is already locked, the calling thread will block until the mutex becomes available.
pthread_mutex_unlock Unlocks mutex.
pthread_mutexattr_init Initializes attr with all the default mutex attributes.

Thread Attributes

Function

Description

pthread_attr_destroy Destroys attrib.
pthread_attr_init Initializes attrib with all the default thread attributes.

Thread-Specific Data

Function

Description

pthread_getspecific Returns the thread-specific data value associated with the given key.
pthread_key_create Creates a thread-specific data key visible to all threads in the process.
pthread_setspecific Associates a thread-specific value with a key obtained via a previous call to pthread_key_create.

 


Pseudo Functions

Functions Description
pthread_condattr_init Destroys and initializes the condition variable attributes object
pthread_condattr_destroy Destroys and initializes the condition variable attributes object
pthread_attr_setscope Gets and sets the contentionscope attribute
pthread_attr_getscope Gets and sets the contentionscope attribute
pthread_attr_setschedpolicy Gets and sets the schedpolicy attribute
pthread_attr_getschedpolicy Gets and sets the schedpolicy attribute
pthread_setschedparam Dynamic thread scheduling parameters access
pthread_getschedparam Dynamic thread scheduling parameters access
pthread_mutexattr_setpshared Gets and sets the process-shared attribute
pthread_mutexattr_getpshared Gets and sets the process-shared attribute

Give feedback of this article


©Nokia 2007

Back to top


This material, including documentation and any related computer programs, is protected by copyright controlled by Nokia. All rights are reserved. Copying, including reproducing, storing, adapting or translating, any or all of this material requires the prior written consent of Nokia. This material also contains confidential information, which may not be disclosed to others without the prior written consent of Nokia.

Nokia is a registered trademark of Nokia Corporation. S60 and logo is a trademark of Nokia Corporation. Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. Other company and product names mentioned herein may be trademarks or tradenames of their respective owners.