mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
The video decoding thread efficiently waits for a video to be created before doing anything, rather than sleeping for 2ms in a loop. Reduces the CPU usage of the video worker thread to ~0% when no videos are loaded.
This commit is contained in:
@@ -43,7 +43,7 @@ Lock::~Lock()
|
||||
}
|
||||
|
||||
EmptyLock::EmptyLock()
|
||||
: mutex(0)
|
||||
: mutex(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -119,5 +119,30 @@ MutexRef::operator Mutex*() const
|
||||
return mutex;
|
||||
}
|
||||
|
||||
Mutex *MutexRef::operator->() const
|
||||
{
|
||||
return mutex;
|
||||
}
|
||||
|
||||
ConditionalRef::ConditionalRef()
|
||||
: conditional(newConditional())
|
||||
{
|
||||
}
|
||||
|
||||
ConditionalRef::~ConditionalRef()
|
||||
{
|
||||
delete conditional;
|
||||
}
|
||||
|
||||
ConditionalRef::operator Conditional*() const
|
||||
{
|
||||
return conditional;
|
||||
}
|
||||
|
||||
Conditional *ConditionalRef::operator->() const
|
||||
{
|
||||
return conditional;
|
||||
}
|
||||
|
||||
} // thread
|
||||
} // love
|
||||
|
||||
Reference in New Issue
Block a user