Bug 1833782 Comment 6 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

(In reply to Nick Rishel [:nrishel] from comment #5)
> Is there a reason this can't be paired with a guard for initialization started?

I am not sure if I understand the question correctly, so feel free to correct me. The purpose of `_cairo_mutex_initialize` is to initialize the synchronization primitives that are used by the rest of the cairo code. It only needs to be called only once, so it would be more optimal to just call it ahead of use in an initialization path, rather than to guard the path to make it thread-safe (which would require to use a synchronization primitive which would itself have to be initialized ahead of use). However, both solutions would fix the crash.
(In reply to Nick Rishel [:nrishel] from comment #5)
> Is there a reason this can't be paired with a guard for initialization started?

I am not sure if I understand the question correctly, so feel free to correct me. The purpose of `_cairo_mutex_initialize` is to initialize the synchronization primitives that are used by the rest of the cairo code. It needs to be called only once, so it would be more optimal to just call it ahead of use in an initialization path, rather than to guard the path to make it thread-safe (which would require to use a synchronization primitive which would itself have to be initialized ahead of use). However, both solutions would fix the crash.
(In reply to Nick Rishel [:nrishel] from comment #5)
> Is there a reason this can't be paired with a guard for initialization started?

I am not sure if I understand the question correctly, so feel free to correct me. The purpose of `_cairo_mutex_initialize` is to initialize the synchronization primitives that are used by the rest of the cairo code. It needs to be called only once, so it would be more optimal to just call it ahead of use in an initialization path, rather than to guard the path to make it thread-safe (which would require to use a synchronization primitive which would itself have to be initialized ahead of use). However, both solutions would fix the crash (assuming the analysis from comment 4 is correct).

Back to Bug 1833782 Comment 6