xfs
[Top] [All Lists]

Re: [PATCH 3/8] xfsdump: implement lock abstraction with pthreads

To: Bill Kendall <wkendall@xxxxxxx>
Subject: Re: [PATCH 3/8] xfsdump: implement lock abstraction with pthreads
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Thu, 3 Nov 2011 03:10:54 -0400
Cc: xfs@xxxxxxxxxxx
In-reply-to: <1320268254-20583-4-git-send-email-wkendall@xxxxxxx>
References: <1320268254-20583-1-git-send-email-wkendall@xxxxxxx> <1320268254-20583-4-git-send-email-wkendall@xxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
> +struct qsem {
> +     ix_t qs_count;
> +             /* current count of this semaphore
> +              */
> +     ix_t qs_waiters;
> +             /* number of threads waiting on semaphore
> +              */
> +     pthread_mutex_t qs_mutex;
> +     pthread_cond_t qs_cond;
> +};
> +typedef struct  qsem qsem_t;

Can't you use Posix Semaphores directly?

See http://www.csc.villanova.edu/~mdamian/threads/posixsem.html for
a quick introduction.

<Prev in Thread] Current Thread [Next in Thread>