TipcSrvConnLock


Name

TipcSrvConnLock — acquire exclusive access to the connection

Synopsis

T_BOOL TipcSrvConnLock(srv) 
T_IPC_SRV srv; 

Arguments

srv — connection handle to RTserver

Return Values

TRUE if the connection to RTserver was successfully locked, FALSE otherwise.

Diagnostics

If TipcSrvConnLock fails, it returns FALSE and sets the global SmartSockets error number to one of:

Description

TipcSrvConnLock locks all of the internal synchronization objects within the connection to RTserver. This insures that the calling thread in a multi-threaded process has exclusive access to the connection to RTserver. TipcSrvConnLock may be called by a thread recursively.

Caution

Every call to TipcSrvConnLock must be balanced by a call to TipcSrvConnUnlock.

See Also

TipcConnLock, TipcSrvConnUnlock

Examples

This example locks and unlocks the connection to RTserver:

if (!TipcSrvConnLock(srv)) { 
  return;  /* error */ 
} 
 
/* At this point, several TipcSrvConn* functions could be called and there would be no risk of any 
other thread accessing the connection. The connection must be unlocked with TipcSrvConnUnlock 
when exclusive access is no longer needed. */ 
 
if (!TipcSrvConnUnlock(srv)) { 
  return;  /* error */ 
} 

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