Hold or release the lock on a logical socket in Card Services.
#include <sys/pcmciacs.h> #include <sys/pcmciaAix.h> CSaixVdrSpcPkt pkt = { Socket, CSaixLockSocket, actioncode, /* other members are not used */ };
int status = CardServices( CSVendorSpecific, clientID, 0, sizeof( pkt ), &pkt); int* clientID;
Socket | Logical Socket Number to hold or release a lock. |
actioncode | _CSaixHoldLock to hold a lock, _CSaixReleaseLock to release a lock. |
clientID | Client ID |
CSaixLockSocket is called to hold or release the lock on a logical socket in Card Services. Other threads who want to access the socket need to wait until the lock is released. The thread who holds the lock should not wait for the events from Card Services, because event handler thread in Card Services is also blocked to access the socket. Also, it should not hold or release other locks in a device driver or kernel while the lock is held.
The lock is desired to hold when a client starts card's configuration or unconfiguration, because accessing PCMCIA card during card's configuration or unconfiguration by the other threads may cause the system to hang.
CSR_SUCCESS | Specifies a successful function. |
CSR_BAD_SOCKET | Socket number is wrong or the lock is already held/released. |
0 | Specifies success. |