httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Havard" <>
Subject Re: possible APIs for no-wait APR locks
Date Tue, 20 Jun 2000 01:22:56 GMT
On Mon, 19 Jun 2000 15:28:24 -0400, Jeff Trawick wrote:

>All of the underlying lock mechanisms used by APR support no-wait
>locks, but APR doesn't expose this functionality.  I'd like to get
>this implemented, as it is helpful for something I wanted to play
>with.  (I could hack something up pretty quickly, but I think other
>folks could use it so I'd rather spend the time now getting it in
>APR than hacking around with the current code, only to throw it away
>Here are a few possibilities for API changes.  I prefer plan a.  I
>have no preference among b and c.  Other ideas?
>plan a:
>  ap_create_lock() interface unchanged
>  ap_lock() interface unchanged
>  add new ap_set_lock_nowait() function
>  (ap_set_lock_wait() could possibly be added in the future if
>  somebody needs it)

How about adding a timeout value as a parameter, 0 indicating no wait, -1
for indefinite. I know both OS/2 & Win32 APIs support that directly
(DosRequestMutexSem() & WaitForSingleObject()) though I don't know about
unix or BeOS.

 |  Brian Havard                 |  "He is not the messiah!                   |
 |  |  He's a very naughty boy!" - Life of Brian |

View raw message