TipcInitThreads


Name

TipcInitThreads — enable thread-safety on supported platforms

Synopsis

T_BOOL TipcInitThreads() 

Arguments

None

Return Values

TRUE if threads are supported for the operating system, FALSE if not.

Diagnostics

If TipcInitThreads fails, it returns FALSE and sets the global SmartSockets error number to:

Description

TipcInitThreads initializes the thread API and turns on internal thread synchronization calls within the utility and IPC libraries. Programs that call SmartSockets API functions from more than one thread must first call this function, even if they do not use any of the other thread API functions. This protects the integrity of the library’s internal data structures.

Single-threaded programs do not need to call TipcInitThreads, and indeed should avoid doing so for optimum performance. The added overhead of internal thread synchronization calls is not needed for single-threaded programs.

Caution

If threads are to be used within a program, TipcInitThreads must be called before any other SmartSockets function.

The T_ENTRY declaration specifier is required in the definition of all thread entry functions as well as their prototypes.

See Also

None

Examples

This example enables the thread-safety features of SmartSockets and checks to ensure that they are supported on the current platform:

int main() 
{ 
  if (!TipcInitThreads()) { 
    return;  /* error */ 
  } 
} 

TIBCO SmartSockets™ Application Programming Interface
Software Release 6.8, July 2006
Copyright © TIBCO Software Inc. All rights reserved
www.tibco.com