1 /***************************************************************************
3 * Copyright (C) Lakshya Solutions Ltd. All rights reserved. *
5 ***************************************************************************/
10 typedef unsigned int Lock
;
14 #if defined(sparc) || defined(i686) || defined (x86_64)
17 pthread_mutex_t mutex_
;
24 int tryLock(int tries
=0, int waitmsecs
=0,bool share
=false);
25 int getLock(int procSlot
, bool procAccount
=true,bool share
=false);
26 int releaseLock(int procSlot
, bool procAccount
=true,bool share
=false);
29 static int CASL(long *ptr
, long oldVal
, long newVal
);
30 static int CAS(int *ptr
, int oldVal
, int newVal
);