apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@rowe-clan.net>
Subject testglobalmutex.c
Date Mon, 15 Mar 2004 18:51:02 GMT

>rbb         2004/03/15 10:33:30
>
>  1.1                  apr/test/globalmutexchild.c
>...  
>  int main(int argc, const char * const argv[])
>  {
>      apr_pool_t *p;
>      int i = 0;
>      apr_global_mutex_t *global_lock;
>  
>      apr_initialize();
>      atexit(apr_terminate);
>      
>      apr_pool_create(&p, NULL);
>      apr_global_mutex_create(&global_lock, LOCKNAME, APR_LOCK_DEFAULT, p);
>      apr_global_mutex_child_init(&global_lock, LOCKNAME, p);

Hold on :)  You *created* the lock in the testall.exe process right?

Now you want a child to use the same mutex - not to create another,
so the apr_global_mutex_create is redundant and harmful.





Mime
View raw message