Skip to content

Commit 1bb7b97

Browse files
committed
LibGfx: Use recursive mutex where needed
This commit makes the skia backend context use a recursive mutex as the normal one is now not recursive. Same for the pulse audio context.
1 parent 810b9ec commit 1bb7b97

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

Libraries/LibCore/EventLoopImplementationUnix.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ struct ThreadData {
267267
s_thread_data.remove(s_thread_id);
268268
}
269269

270-
Sync::Mutex mutex;
270+
Sync::RecursiveMutex mutex;
271271

272272
// Each thread has its own timers, notifiers and a wake pipe.
273273
TimeoutSet timeouts;

Libraries/LibGfx/SkiaBackendContext.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class SkiaBackendContext : public AtomicRefCounted<SkiaBackendContext> {
5252
void unlock() { m_mutex.unlock(); }
5353

5454
private:
55-
Sync::Mutex m_mutex;
55+
Sync::RecursiveMutex m_mutex;
5656
};
5757

5858
}

Libraries/LibMedia/Audio/PulseAudioWrappers.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
namespace Audio {
1212

1313
static PulseAudioContext* s_pulse_audio_context;
14-
static Sync::Mutex s_pulse_audio_context_mutex;
14+
static Sync::RecursiveMutex s_pulse_audio_context_mutex;
1515

1616
ErrorOr<NonnullRefPtr<PulseAudioContext>> PulseAudioContext::the()
1717
{

Libraries/LibMedia/Providers/AudioDataProvider.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ class MEDIA_API AudioDataProvider : public AtomicRefCounted<AudioDataProvider> {
8484

8585
Core::EventLoop& m_main_thread_event_loop;
8686

87-
mutable Sync::Mutex m_mutex;
88-
mutable Sync::ConditionVariable m_wait_condition { m_mutex };
87+
mutable Sync::RecursiveMutex m_mutex;
88+
mutable Sync::RecursiveConditionVariable m_wait_condition { m_mutex };
8989
RequestedState m_requested_state { RequestedState::None };
9090

9191
NonnullRefPtr<MutexedDemuxer> m_demuxer;

Libraries/LibMedia/Providers/VideoDataProvider.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ class MEDIA_API VideoDataProvider final : public AtomicRefCounted<VideoDataProvi
8787

8888
Core::EventLoop& m_main_thread_event_loop;
8989

90-
mutable Sync::Mutex m_mutex;
91-
mutable Sync::ConditionVariable m_wait_condition { m_mutex };
90+
mutable Sync::RecursiveMutex m_mutex;
91+
mutable Sync::RecursiveConditionVariable m_wait_condition { m_mutex };
9292
RequestedState m_requested_state { RequestedState::None };
9393

9494
NonnullRefPtr<MutexedDemuxer> m_demuxer;

0 commit comments

Comments
 (0)