TipcConnLock


Name

TipcConnLock — acquire exclusive access to a connection

Synopsis

T_BOOL TipcConnLock(conn) 
T_IPC_CONN conn; 

Arguments

conn — connection to lock

Return Values

TRUE if connection was successfully locked, FALSE if error occurred.

Diagnostics

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

Description

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

Caution

Every call to TipcConnLock must be balanced by a call to TipcConnUnlock.

See Also

TipcConnUnlock

Examples

This example locks and unlocks a connection:

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

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