BMediaFormats::InitCheck() now checks if the global lock could be initialized
to give its existance a bit more sense. update_media_formats() no longer ASSERTS if the lock is held, but fails if it's not locked. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6300 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -261,7 +261,8 @@ meta_format::Compare(const meta_format *a, const meta_format *b)
|
||||
static status_t
|
||||
update_media_formats()
|
||||
{
|
||||
ASSERT(sLock.IsLocked());
|
||||
if (!sLock.IsLocked())
|
||||
return B_NOT_ALLOWED;
|
||||
|
||||
BMessage request(MEDIA_SERVER_GET_FORMATS);
|
||||
request.AddInt64("last_timestamp", sLastFormatsUpdate);
|
||||
@@ -337,7 +338,7 @@ BMediaFormats::~BMediaFormats()
|
||||
status_t
|
||||
BMediaFormats::InitCheck()
|
||||
{
|
||||
return B_OK;
|
||||
return sLock.Sem() >= B_OK ? B_OK : sLock.Sem();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user