Re: plea for review



Before starting to review the actual locking i'd like to state that the
following locking primitive is completely bogus:

static gint type_rw_lock = 0;
#define	G_READ_LOCK(rw_lock)	{ if (*(rw_lock)!=0) g_error (G_STRLOC": read lock invalid (lock=%u)", *(rw_lock)); *(rw_lock)=1; }
#define	G_READ_UNLOCK(rw_lock)	{ if (*(rw_lock)!=1) g_error (G_STRLOC": read unlock invalid (lock=%u)", *(rw_lock)); *(rw_lock)=0; }
#define	G_WRITE_LOCK(rw_lock)	{ if (*(rw_lock)!=0) g_error (G_STRLOC": write lock invalid (lock=%u)", *(rw_lock)); *(rw_lock)=2; }
#define	G_WRITE_UNLOCK(rw_lock)	{ if (*(rw_lock)!=2) g_error (G_STRLOC": write unlock invalid (lock=%u)", *(rw_lock)); *(rw_lock)=0; }

There are so many problems with it I won't even get started on it. I
assume you're gonna replace this later with some real thing?

/ Alex









[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]