mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-04-21 22:59:16 +02:00
GMappedFile: remove nonatomic accesses to ref_count
This commit is contained in:
parent
ae96118395
commit
4971c43da8
@ -315,7 +315,6 @@ GMappedFile *
|
|||||||
g_mapped_file_ref (GMappedFile *file)
|
g_mapped_file_ref (GMappedFile *file)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (file != NULL, NULL);
|
g_return_val_if_fail (file != NULL, NULL);
|
||||||
g_return_val_if_fail (file->ref_count > 0, file);
|
|
||||||
|
|
||||||
g_atomic_int_inc (&file->ref_count);
|
g_atomic_int_inc (&file->ref_count);
|
||||||
|
|
||||||
@ -337,7 +336,6 @@ void
|
|||||||
g_mapped_file_unref (GMappedFile *file)
|
g_mapped_file_unref (GMappedFile *file)
|
||||||
{
|
{
|
||||||
g_return_if_fail (file != NULL);
|
g_return_if_fail (file != NULL);
|
||||||
g_return_if_fail (file->ref_count > 0);
|
|
||||||
|
|
||||||
if (g_atomic_int_dec_and_test (&file->ref_count))
|
if (g_atomic_int_dec_and_test (&file->ref_count))
|
||||||
g_mapped_file_destroy (file);
|
g_mapped_file_destroy (file);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user