|
Boost Users : |
Subject: Re: [Boost-users] [interprocess] Mutex Query
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2009-05-20 11:48:12
Rick Way wrote:
> I want to make sure that when my program exits ungracefully (CTRL-C, seg
> fault, etc) it releases a Boost.Interprocess named_upgradable_mutex, if
> it's holding it. I've created a signal handler to catch these ungraceful
> exits. Is there any way to tell if my process currently holds an
> exclusive or sharable lock on the mutex?
>
> I've tried blindly calling mutex.unlock() and mutex.unlock_sharable()
> but that seems to permanently lock the mutex when the shareable lock is set.
Sorry, there is no way to do this. You'll need to mark this type of
information externally in the structure where the mutex resides.
Ion
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net