AppServerLink: Switch to a recursive lock.
It seems in some applications (though not most of the ones I initially tested) this can get used recursively, so we need a recursive_lock in order to not deadlock. Also commit a missed change from the previous commit.
This commit is contained in:
@@ -12,7 +12,6 @@
|
||||
|
||||
|
||||
#include <OS.h>
|
||||
#include <Locker.h>
|
||||
#include <LinkReceiver.h>
|
||||
#include <LinkSender.h>
|
||||
|
||||
@@ -34,7 +33,7 @@ class BGradient;
|
||||
|
||||
namespace BPrivate {
|
||||
|
||||
class ServerLink : public BLocker {
|
||||
class ServerLink {
|
||||
public:
|
||||
ServerLink();
|
||||
virtual ~ServerLink();
|
||||
|
||||
@@ -24,14 +24,14 @@
|
||||
*/
|
||||
|
||||
|
||||
static mutex sLock = MUTEX_INITIALIZER("AppServerLink_sLock");
|
||||
static recursive_lock sLock = MUTEX_INITIALIZER("AppServerLink_sLock");
|
||||
|
||||
|
||||
namespace BPrivate {
|
||||
|
||||
AppServerLink::AppServerLink()
|
||||
{
|
||||
mutex_lock(&sLock);
|
||||
recursive_lock_lock(&sLock);
|
||||
|
||||
// if there is no be_app, we can't do a whole lot, anyway
|
||||
if (be_app != NULL) {
|
||||
@@ -45,7 +45,7 @@ AppServerLink::AppServerLink()
|
||||
|
||||
AppServerLink::~AppServerLink()
|
||||
{
|
||||
mutex_unlock(&sLock);
|
||||
recursive_lock_unlock(&sLock);
|
||||
}
|
||||
|
||||
} // namespace BPrivate
|
||||
|
||||
Reference in New Issue
Block a user