Ticket #38657: patch-port-glib2-2.6.31-and-up.diff
File patch-port-glib2-2.6.31-and-up.diff, 23.3 KB (added by Ionic (Mihai Moldovan), 12 years ago) |
---|
-
daemon/daemon-connection.c
old new 67 67 gint32 id; 68 68 } FileHandle; 69 69 70 static G StaticMutex cancellations_lock = G_STATIC_MUTEX_INIT;70 static GMutex cancellations_lock; 71 71 static GHashTable *cancellations; 72 72 73 static G StaticMutex directory_handles_lock = G_STATIC_MUTEX_INIT;73 static GMutex directory_handles_lock; 74 74 static GHashTable *directory_handles; 75 75 static guint next_directory_id = 1; 76 76 77 static G StaticMutex file_handles_lock = G_STATIC_MUTEX_INIT;77 static GMutex file_handles_lock; 78 78 static GHashTable *file_handles; 79 79 static guint next_file_id = 1; 80 80 … … 239 239 } 240 240 dbus_connection_unref (conn->conn); 241 241 242 g_ static_mutex_lock (&directory_handles_lock);242 g_mutex_lock (&directory_handles_lock); 243 243 if (directory_handles) { 244 244 g_hash_table_foreach_remove (directory_handles, 245 245 directory_handle_last_conn_is, 246 246 conn); 247 247 } 248 g_ static_mutex_unlock (&directory_handles_lock);248 g_mutex_unlock (&directory_handles_lock); 249 249 250 g_ static_mutex_lock (&file_handles_lock);250 g_mutex_lock (&file_handles_lock); 251 251 if (file_handles) { 252 252 g_hash_table_foreach_remove (file_handles, 253 253 file_handle_last_conn_is, 254 254 conn); 255 255 } 256 g_ static_mutex_unlock (&file_handles_lock);256 g_mutex_unlock (&file_handles_lock); 257 257 258 258 g_assert (!g_main_loop_is_running (conn->main_loop)); 259 259 … … 320 320 321 321 handle = cancellation_handle_new (id, conn->conn_id); 322 322 323 g_ static_mutex_lock (&cancellations_lock);323 g_mutex_lock (&cancellations_lock); 324 324 if (cancellations == NULL) { 325 325 cancellations = g_hash_table_new_full (cancellation_handle_hash, cancellation_handle_equal, 326 326 NULL, (GDestroyNotify) cancellation_handle_free); 327 327 } 328 328 329 329 g_hash_table_insert (cancellations, handle, handle); 330 g_ static_mutex_unlock (&cancellations_lock);330 g_mutex_unlock (&cancellations_lock); 331 331 332 332 return handle; 333 333 } … … 338 338 { 339 339 d(g_print ("Removing cancellation handle %d\n", handle->id)); 340 340 341 g_ static_mutex_lock (&cancellations_lock);341 g_mutex_lock (&cancellations_lock); 342 342 if (!g_hash_table_remove (cancellations, handle)) { 343 343 g_warning ("Could't remove cancellation."); 344 344 } 345 g_ static_mutex_unlock (&cancellations_lock);345 g_mutex_unlock (&cancellations_lock); 346 346 } 347 347 348 348 /* Note: This is called from the main thread. */ … … 354 354 355 355 handle = NULL; 356 356 357 g_ static_mutex_lock (&cancellations_lock);357 g_mutex_lock (&cancellations_lock); 358 358 359 359 lookup.conn_id = conn_id; 360 360 lookup.id = cancellation_id; … … 368 368 } 369 369 } 370 370 371 g_ static_mutex_unlock (&cancellations_lock);371 g_mutex_unlock (&cancellations_lock); 372 372 } 373 373 374 374 … … 408 408 { 409 409 DirectoryHandle *handle; 410 410 411 g_ static_mutex_lock (&directory_handles_lock);411 g_mutex_lock (&directory_handles_lock); 412 412 handle = directory_handle_new (conn, vfs_handle, next_directory_id++); 413 413 414 414 if (directory_handles == NULL) { … … 418 418 419 419 g_hash_table_insert (directory_handles, 420 420 GINT_TO_POINTER (handle->id), handle); 421 g_ static_mutex_unlock (&directory_handles_lock);421 g_mutex_unlock (&directory_handles_lock); 422 422 423 423 return handle; 424 424 } … … 426 426 static void 427 427 remove_directory_handle (DirectoryHandle *handle) 428 428 { 429 g_ static_mutex_lock (&directory_handles_lock);429 g_mutex_lock (&directory_handles_lock); 430 430 if (!g_hash_table_remove (directory_handles, 431 431 GINT_TO_POINTER (handle->id))) { 432 432 g_warning ("Couldn't remove directory handle %d\n", 433 433 handle->id); 434 434 } 435 g_ static_mutex_unlock (&directory_handles_lock);435 g_mutex_unlock (&directory_handles_lock); 436 436 } 437 437 438 438 static DirectoryHandle * … … 441 441 { 442 442 DirectoryHandle *handle; 443 443 444 g_ static_mutex_lock (&directory_handles_lock);444 g_mutex_lock (&directory_handles_lock); 445 445 handle = g_hash_table_lookup (directory_handles, 446 446 GINT_TO_POINTER (id)); 447 447 if (handle) { 448 448 handle->last_connection = conn; 449 449 } 450 g_ static_mutex_unlock (&directory_handles_lock);450 g_mutex_unlock (&directory_handles_lock); 451 451 return handle; 452 452 } 453 453 … … 487 487 { 488 488 FileHandle *handle; 489 489 490 g_ static_mutex_lock (&file_handles_lock);490 g_mutex_lock (&file_handles_lock); 491 491 handle = file_handle_new (conn, vfs_handle, next_file_id++); 492 492 493 493 if (file_handles == NULL) { … … 497 497 498 498 g_hash_table_insert (file_handles, 499 499 GINT_TO_POINTER (handle->id), handle); 500 g_ static_mutex_unlock (&file_handles_lock);500 g_mutex_unlock (&file_handles_lock); 501 501 502 502 return handle; 503 503 } … … 505 505 static void 506 506 remove_file_handle (FileHandle *handle) 507 507 { 508 g_ static_mutex_lock (&file_handles_lock);508 g_mutex_lock (&file_handles_lock); 509 509 if (!g_hash_table_remove (file_handles, 510 510 GINT_TO_POINTER (handle->id))) { 511 511 g_warning ("Couldn't remove file handle %d\n", handle->id); 512 512 } 513 g_ static_mutex_unlock (&file_handles_lock);513 g_mutex_unlock (&file_handles_lock); 514 514 } 515 515 516 516 static FileHandle * … … 519 519 { 520 520 FileHandle *handle; 521 521 522 g_ static_mutex_lock (&file_handles_lock);522 g_mutex_lock (&file_handles_lock); 523 523 handle = g_hash_table_lookup (file_handles, 524 524 GINT_TO_POINTER (id)); 525 525 if (handle) { 526 526 handle->last_connection = conn; 527 527 } 528 g_ static_mutex_unlock (&file_handles_lock);528 g_mutex_unlock (&file_handles_lock); 529 529 530 530 return handle; 531 531 } -
libgnomevfs/gnome-vfs-async-job-map.c
old new 27 27 #include <glib.h> 28 28 29 29 /* job map bits guarded by this lock */ 30 static G StaticRecMutex async_job_map_lock = G_STATIC_REC_MUTEX_INIT;30 static GRecMutex async_job_map_lock; 31 31 static guint async_job_map_next_id; 32 32 static int async_job_map_locked = 0; 33 33 static gboolean async_job_map_shutting_down; 34 34 static GHashTable *async_job_map; 35 35 36 36 /* callback map bits guarded by this lock */ 37 static G StaticMutex async_job_callback_map_lock = G_STATIC_MUTEX_INIT;37 static GMutex async_job_callback_map_lock; 38 38 static GHashTable *async_job_callback_map; 39 39 static guint async_job_callback_map_next_id; 40 40 … … 161 161 void 162 162 _gnome_vfs_async_job_map_lock (void) 163 163 { 164 g_ static_rec_mutex_lock (&async_job_map_lock);164 g_rec_mutex_lock (&async_job_map_lock); 165 165 async_job_map_locked++; 166 166 } 167 167 … … 169 169 _gnome_vfs_async_job_map_unlock (void) 170 170 { 171 171 async_job_map_locked--; 172 g_ static_rec_mutex_unlock (&async_job_map_lock);172 g_rec_mutex_unlock (&async_job_map_lock); 173 173 } 174 174 175 175 void … … 185 185 { 186 186 GnomeVFSNotifyResult *notify_result; 187 187 188 g_ static_mutex_lock (&async_job_callback_map_lock);188 g_mutex_lock (&async_job_callback_map_lock); 189 189 190 190 if (async_job_callback_map == NULL) { 191 191 g_assert (async_job_map_shutting_down); … … 199 199 *valid = notify_result != NULL; 200 200 *cancelled = notify_result != NULL && notify_result->cancelled; 201 201 202 g_ static_mutex_unlock (&async_job_callback_map_lock);202 g_mutex_unlock (&async_job_callback_map_lock); 203 203 } 204 204 205 205 gboolean … … 207 207 { 208 208 gboolean cancelled; 209 209 210 g_ static_mutex_lock (&async_job_callback_map_lock);210 g_mutex_lock (&async_job_callback_map_lock); 211 211 212 212 g_assert (!async_job_map_shutting_down); 213 213 … … 232 232 g_hash_table_insert (async_job_callback_map, GUINT_TO_POINTER (notify_result->callback_id), 233 233 notify_result); 234 234 } 235 g_ static_mutex_unlock (&async_job_callback_map_lock);235 g_mutex_unlock (&async_job_callback_map_lock); 236 236 237 237 return !cancelled; 238 238 } … … 243 243 g_assert (async_job_callback_map != NULL); 244 244 245 245 JOB_DEBUG (("removing callback %d ", callback_id)); 246 g_ static_mutex_lock (&async_job_callback_map_lock);246 g_mutex_lock (&async_job_callback_map_lock); 247 247 248 248 g_hash_table_remove (async_job_callback_map, GUINT_TO_POINTER (callback_id)); 249 249 250 g_ static_mutex_unlock (&async_job_callback_map_lock);250 g_mutex_unlock (&async_job_callback_map_lock); 251 251 } 252 252 253 253 static void … … 268 268 void 269 269 _gnome_vfs_async_job_cancel_job_and_callbacks (GnomeVFSAsyncHandle *job_handle, GnomeVFSJob *job) 270 270 { 271 g_ static_mutex_lock (&async_job_callback_map_lock);271 g_mutex_lock (&async_job_callback_map_lock); 272 272 273 273 if (job != NULL) { 274 274 job->cancelled = TRUE; … … 282 282 callback_map_cancel_one, job_handle); 283 283 } 284 284 285 g_ static_mutex_unlock (&async_job_callback_map_lock);285 g_mutex_unlock (&async_job_callback_map_lock); 286 286 } 287 287 288 288 void 289 289 async_job_callback_map_destroy (void) 290 290 { 291 g_ static_mutex_lock (&async_job_callback_map_lock);291 g_mutex_lock (&async_job_callback_map_lock); 292 292 293 293 if (async_job_callback_map) { 294 294 g_hash_table_destroy (async_job_callback_map); 295 295 async_job_callback_map = NULL; 296 296 } 297 297 298 g_ static_mutex_unlock (&async_job_callback_map_lock);298 g_mutex_unlock (&async_job_callback_map_lock); 299 299 } -
libgnomevfs/gnome-vfs-daemon-method.c
old new 81 81 static DBusHandlerResult connection_message_func (DBusConnection *conn, 82 82 DBusMessage *message, 83 83 gpointer data); 84 static void 85 destroy_private_connection (gpointer data) 86 { 87 LocalConnection *ret = data; 88 89 dbus_connection_close (ret->connection); 90 dbus_connection_unref (ret->connection); 91 g_free (ret); 92 } 84 93 85 static G StaticPrivate local_connection_private = G_STATIC_PRIVATE_INIT;94 static GPrivate local_connection_private = G_PRIVATE_INIT (destroy_private_connection); 86 95 87 96 88 97 static DBusObjectPathVTable connection_vtable = { … … 343 352 gchar *sender; 344 353 } CancellationRequest; 345 354 346 static void347 destroy_private_connection (gpointer data)348 {349 LocalConnection *ret = data;350 351 dbus_connection_close (ret->connection);352 dbus_connection_unref (ret->connection);353 g_free (ret);354 }355 355 356 356 static void 357 357 private_connection_died (LocalConnection *connection) 358 358 { 359 g_ static_private_set (&local_connection_private, NULL, NULL);359 g_private_set (&local_connection_private, NULL); 360 360 } 361 361 362 362 static LocalConnection * … … 370 370 dbus_int32_t conn_id; 371 371 LocalConnection *ret; 372 372 373 ret = g_ static_private_get (&local_connection_private);373 ret = g_private_get (&local_connection_private); 374 374 if (ret != NULL) { 375 375 return ret; 376 376 } … … 438 438 ret->conn_id = conn_id; 439 439 ret->handle = 0; 440 440 441 g_ static_private_set (&local_connection_private,442 ret , destroy_private_connection);441 g_private_set (&local_connection_private, 442 ret); 443 443 444 444 return ret; 445 445 } -
libgnomevfs/gnome-vfs-dbus-utils.c
old new 187 187 return main_dbus; 188 188 } 189 189 190 static G StaticPrivate daemon_connection_private = G_STATIC_PRIVATE_INIT;190 static GPrivate daemon_connection_private; 191 191 192 192 DBusConnection * 193 193 _gnome_vfs_daemon_get_current_connection (void) 194 194 { 195 return g_ static_private_get (&daemon_connection_private);195 return g_private_get (&daemon_connection_private); 196 196 } 197 197 198 198 void 199 199 gnome_vfs_daemon_set_current_connection (DBusConnection *conn) 200 200 { 201 g_ static_private_set (&daemon_connection_private, conn, NULL);201 g_private_set (&daemon_connection_private, conn); 202 202 } -
libgnomevfs/gnome-vfs-file-info.c
old new 31 31 /* Mutex for making GnomeVFSFileInfo ref's/unref's atomic */ 32 32 /* Note that an atomic increment function (such as is present in NSPR) is preferable */ 33 33 /* FIXME: This mutex is probably not needed and might be causing performance issues */ 34 static G StaticMutex file_info_ref_lock = G_STATIC_MUTEX_INIT;34 static GMutex file_info_ref_lock; 35 35 36 36 /* Register GnomeVFSFileInfo in the type system */ 37 37 GType … … 83 83 g_return_if_fail (info != NULL); 84 84 g_return_if_fail (info->refcount > 0); 85 85 86 g_ static_mutex_lock (&file_info_ref_lock);86 g_mutex_lock (&file_info_ref_lock); 87 87 info->refcount += 1; 88 g_ static_mutex_unlock (&file_info_ref_lock);88 g_mutex_unlock (&file_info_ref_lock); 89 89 90 90 } 91 91 … … 101 101 g_return_if_fail (info != NULL); 102 102 g_return_if_fail (info->refcount > 0); 103 103 104 g_ static_mutex_lock (&file_info_ref_lock);104 g_mutex_lock (&file_info_ref_lock); 105 105 info->refcount -= 1; 106 g_ static_mutex_unlock (&file_info_ref_lock);106 g_mutex_unlock (&file_info_ref_lock); 107 107 108 108 if (info->refcount == 0) { 109 109 gnome_vfs_file_info_clear (info); … … 133 133 g_free (info->selinux_context); 134 134 135 135 /* Ensure the ref count is maintained correctly */ 136 g_ static_mutex_lock (&file_info_ref_lock);136 g_mutex_lock (&file_info_ref_lock); 137 137 138 138 old_refcount = info->refcount; 139 139 memset (info, 0, sizeof (*info)); 140 140 info->refcount = old_refcount; 141 141 142 g_ static_mutex_unlock (&file_info_ref_lock);142 g_mutex_unlock (&file_info_ref_lock); 143 143 } 144 144 145 145 … … 182 182 * want serialize access differently (or perhaps you shouldn't 183 183 * use copy) 184 184 */ 185 g_ static_mutex_lock (&file_info_ref_lock);185 g_mutex_lock (&file_info_ref_lock); 186 186 187 187 old_refcount = dest->refcount; 188 188 … … 199 199 200 200 dest->refcount = old_refcount; 201 201 202 g_ static_mutex_unlock (&file_info_ref_lock);202 g_mutex_unlock (&file_info_ref_lock); 203 203 204 204 } 205 205 -
libgnomevfs/gnome-vfs-init.c
old new 122 122 return FALSE; 123 123 } 124 124 125 if (!g_thread_supported ())126 g_thread_init (NULL);127 125 128 126 G_LOCK (vfs_already_initialized); 129 127 … … 235 233 gboolean 236 234 gnome_vfs_is_primary_thread (void) 237 235 { 238 if (g_thread_supported()) { 239 return GPOINTER_TO_UINT(g_private_get (private_is_primary_thread)) == 1; 240 } else { 241 return TRUE; 242 } 236 return GPOINTER_TO_UINT(g_private_get (private_is_primary_thread)) == 1; 243 237 } -
libgnomevfs/gnome-vfs-job.c
old new 43 43 #include <string.h> 44 44 #include <unistd.h> 45 45 46 static G StaticPrivate job_private = G_STATIC_PRIVATE_INIT;46 static GPrivate job_private; 47 47 48 48 #if GNOME_VFS_JOB_DEBUG 49 49 … … 64 64 * Since this id debug only, just use what the macro should be here. 65 65 * even though it is not portable. 66 66 */ 67 G StaticMutex debug_mutex = G_STATIC_MUTEX_INIT;67 GMutex debug_mutex; 68 68 #endif 69 69 70 70 static int job_count = 0; … … 1734 1734 set_current_job (GnomeVFSJob *job) 1735 1735 { 1736 1736 /* There shouldn't have been anything here. */ 1737 g_assert (g_ static_private_get (&job_private) == NULL);1737 g_assert (g_private_get (&job_private) == NULL); 1738 1738 1739 g_ static_private_set (&job_private, job, NULL);1739 g_private_set (&job_private, job); 1740 1740 1741 1741 _gnome_vfs_module_callback_use_stack_info (job->op->stack_info); 1742 1742 _gnome_vfs_module_callback_set_in_async_thread (TRUE); … … 1745 1745 static void 1746 1746 clear_current_job (void) 1747 1747 { 1748 g_ static_private_set (&job_private, NULL, NULL);1748 g_private_set (&job_private, NULL); 1749 1749 1750 1750 _gnome_vfs_module_callback_clear_stacks (); 1751 1751 } … … 1757 1757 1758 1758 g_return_if_fail (context != NULL); 1759 1759 1760 job = g_ static_private_get (&job_private);1760 job = g_private_get (&job_private); 1761 1761 1762 1762 if (job != NULL) { 1763 1763 *context = job->op->context; … … 1777 1777 GnomeVFSJob *job; 1778 1778 GnomeVFSNotifyResult notify_result; 1779 1779 1780 job = g_ static_private_get (&job_private);1780 job = g_private_get (&job_private); 1781 1781 1782 1782 g_return_if_fail (job != NULL); 1783 1783 -
libgnomevfs/gnome-vfs-method.c
old new 63 63 64 64 static GHashTable *module_hash = NULL; 65 65 G_LOCK_DEFINE_STATIC (gnome_vfs_method_init); 66 static G StaticRecMutex module_hash_lock = G_STATIC_REC_MUTEX_INIT;66 static GRecMutex module_hash_lock; 67 67 68 68 static GList *module_path_list = NULL; 69 69 … … 343 343 const char *args; 344 344 gboolean run_in_daemon; 345 345 346 g_ static_rec_mutex_lock (&module_hash_lock);346 g_rec_mutex_lock (&module_hash_lock); 347 347 348 348 module_element = g_hash_table_lookup (module_hash, name); 349 349 … … 408 408 g_hash_table_insert (module_hash, module_element->name, module_element); 409 409 410 410 add_module_out: 411 g_ static_rec_mutex_unlock (&module_hash_lock);411 g_rec_mutex_unlock (&module_hash_lock); 412 412 413 413 return module_element; 414 414 } -
libgnomevfs/gnome-vfs-module-callback.c
old new 59 59 60 60 /* -- Global variables -- */ 61 61 62 static G StaticMutex callback_table_lock = G_STATIC_MUTEX_INIT;62 static GMutex callback_table_lock; 63 63 static GHashTable *default_callbacks = NULL; 64 64 static GHashTable *default_async_callbacks = NULL; 65 65 static GHashTable *stack_tables_to_free = NULL; … … 69 69 static GPrivate *in_async_thread_key; 70 70 71 71 static GCond *async_callback_cond; 72 static G StaticMutex async_callback_lock = G_STATIC_MUTEX_INIT;72 static GMutex async_callback_lock; 73 73 74 74 /* -- Helper functions -- */ 75 75 … … 120 120 { 121 121 CallbackResponseData *response_data; 122 122 123 g_ static_mutex_lock (&async_callback_lock);123 g_mutex_lock (&async_callback_lock); 124 124 response_data = data; 125 125 response_data->done = TRUE; 126 126 g_cond_broadcast (async_callback_cond); 127 127 128 g_ static_mutex_unlock (&async_callback_lock);128 g_mutex_unlock (&async_callback_lock); 129 129 } 130 130 131 131 static void … … 146 146 * new mutexes and condition variables all the time. 147 147 */ 148 148 149 g_ static_mutex_lock (&async_callback_lock);149 g_mutex_lock (&async_callback_lock); 150 150 response_data.done = FALSE; 151 151 _gnome_vfs_dispatch_module_callback (async_callback->callback, 152 152 in, in_size, … … 156 156 &response_data); 157 157 while (!response_data.done) { 158 158 g_cond_wait (async_callback_cond, 159 g_static_mutex_get_mutex (&async_callback_lock));159 &async_callback_lock); 160 160 } 161 161 162 g_ static_mutex_unlock (&async_callback_lock);162 g_mutex_unlock (&async_callback_lock); 163 163 } 164 164 165 165 static void … … 410 410 411 411 stack_table = specific; 412 412 413 g_ static_mutex_lock (&callback_table_lock);413 g_mutex_lock (&callback_table_lock); 414 414 if (stack_tables_to_free != NULL) { 415 415 g_hash_table_remove (stack_tables_to_free, stack_table); 416 416 } else { 417 417 stack_table = NULL; 418 418 } 419 g_ static_mutex_unlock (&callback_table_lock);419 g_mutex_unlock (&callback_table_lock); 420 420 421 421 if (stack_table) { 422 422 clear_stack_table (stack_table); … … 443 443 static void 444 444 free_stack_tables_to_free (void) 445 445 { 446 g_ static_mutex_lock (&callback_table_lock);446 g_mutex_lock (&callback_table_lock); 447 447 g_hash_table_foreach_remove (stack_tables_to_free, stack_table_free_hr_func , NULL); 448 448 g_hash_table_destroy (stack_tables_to_free); 449 449 stack_tables_to_free = NULL; 450 g_ static_mutex_unlock (&callback_table_lock);450 g_mutex_unlock (&callback_table_lock); 451 451 } 452 452 453 453 void … … 461 461 462 462 async_callback_cond = g_cond_new (); 463 463 464 g_atexit (free_stack_tables_to_free);464 atexit (free_stack_tables_to_free); 465 465 } 466 466 467 467 static void 468 468 free_default_callbacks (void) 469 469 { 470 g_ static_mutex_lock (&callback_table_lock);470 g_mutex_lock (&callback_table_lock); 471 471 472 472 clear_callback_table (default_callbacks); 473 473 g_hash_table_destroy (default_callbacks); … … 475 475 clear_callback_table (default_async_callbacks); 476 476 g_hash_table_destroy (default_async_callbacks); 477 477 478 g_ static_mutex_unlock (&callback_table_lock);478 g_mutex_unlock (&callback_table_lock); 479 479 } 480 480 481 481 /* This function should only be called with the mutex held. */ … … 486 486 default_callbacks = g_hash_table_new (g_str_hash, g_str_equal); 487 487 default_async_callbacks = g_hash_table_new (g_str_hash, g_str_equal); 488 488 489 g_atexit (free_default_callbacks);489 atexit (free_default_callbacks); 490 490 } 491 491 } 492 492 … … 496 496 { 497 497 /* Initialize per-thread data, if needed. */ 498 498 if (g_private_get (callback_stacks_key) == NULL) { 499 g_ static_mutex_lock (&callback_table_lock);499 g_mutex_lock (&callback_table_lock); 500 500 g_private_set (callback_stacks_key, 501 501 g_hash_table_new (g_str_hash, g_str_equal)); 502 502 g_hash_table_insert (stack_tables_to_free, 503 503 g_private_get (callback_stacks_key), 504 504 GINT_TO_POINTER (1)); 505 g_ static_mutex_unlock (&callback_table_lock);505 g_mutex_unlock (&callback_table_lock); 506 506 } 507 507 508 508 if (g_private_get (async_callback_stacks_key) == NULL) { 509 g_ static_mutex_lock (&callback_table_lock);509 g_mutex_lock (&callback_table_lock); 510 510 g_private_set (async_callback_stacks_key, 511 511 g_hash_table_new (g_str_hash, g_str_equal)); 512 512 g_hash_table_insert (stack_tables_to_free, 513 513 g_private_get (async_callback_stacks_key), 514 514 GINT_TO_POINTER (1)); 515 g_ static_mutex_unlock (&callback_table_lock);515 g_mutex_unlock (&callback_table_lock); 516 516 } 517 517 } 518 518 … … 618 618 619 619 callback_info = callback_info_new (callback, callback_data, destroy_notify); 620 620 621 g_ static_mutex_lock (&callback_table_lock);621 g_mutex_lock (&callback_table_lock); 622 622 623 623 initialize_global_if_needed (); 624 624 insert_callback_into_table (default_callbacks, callback_name, callback_info); 625 625 626 g_ static_mutex_unlock (&callback_table_lock);626 g_mutex_unlock (&callback_table_lock); 627 627 628 628 callback_info_unref (callback_info); 629 629 } … … 730 730 731 731 callback_info = async_callback_info_new (callback, callback_data, notify); 732 732 733 g_ static_mutex_lock (&callback_table_lock);733 g_mutex_lock (&callback_table_lock); 734 734 735 735 initialize_global_if_needed (); 736 736 insert_callback_into_table (default_async_callbacks, callback_name, callback_info); 737 737 738 g_ static_mutex_unlock (&callback_table_lock);738 g_mutex_unlock (&callback_table_lock); 739 739 740 740 callback_info_unref (callback_info); 741 741 } … … 864 864 g_assert (callback != NULL); 865 865 callback_info_ref (callback); 866 866 } else { 867 g_ static_mutex_lock (&callback_table_lock);867 g_mutex_lock (&callback_table_lock); 868 868 initialize_global_if_needed (); 869 869 callback = g_hash_table_lookup (default_async_callbacks, callback_name); 870 870 if (callback != NULL) { 871 871 callback_info_ref (callback); 872 872 } 873 g_ static_mutex_unlock (&callback_table_lock);873 g_mutex_unlock (&callback_table_lock); 874 874 } 875 875 } 876 876 … … 883 883 g_assert (callback != NULL); 884 884 callback_info_ref (callback); 885 885 } else { 886 g_ static_mutex_lock (&callback_table_lock);886 g_mutex_lock (&callback_table_lock); 887 887 initialize_global_if_needed (); 888 888 callback = g_hash_table_lookup (default_callbacks, callback_name); 889 889 if (callback != NULL) { 890 890 callback_info_ref (callback); 891 891 } 892 g_ static_mutex_unlock (&callback_table_lock);892 g_mutex_unlock (&callback_table_lock); 893 893 } 894 894 } 895 895 … … 920 920 stack_info->current_callbacks = g_hash_table_new (g_str_hash, g_str_equal); 921 921 stack_info->current_async_callbacks = g_hash_table_new (g_str_hash, g_str_equal); 922 922 923 g_ static_mutex_lock (&callback_table_lock);923 g_mutex_lock (&callback_table_lock); 924 924 initialize_global_if_needed (); 925 g_ static_mutex_unlock (&callback_table_lock);925 g_mutex_unlock (&callback_table_lock); 926 926 927 927 initialize_per_thread_if_needed (); 928 928 copy_callback_stack_tops (g_private_get (callback_stacks_key), -
libgnomevfs/gnome-vfs-resolve.c
old new 139 139 restart_resolve (void) 140 140 { 141 141 static GTimeVal last_reload = { 0, 0 }; 142 static G StaticMutex mutex = G_STATIC_MUTEX_INIT;142 static GMutex mutex; 143 143 GTimeVal now; 144 144 gboolean ret; 145 145 146 g_ static_mutex_lock (&mutex);146 g_mutex_lock (&mutex); 147 147 g_get_current_time (&now); 148 148 149 149 if ((now.tv_sec - last_reload.tv_sec) > RELOAD_TIMEVAL) { … … 155 155 ret = FALSE; 156 156 } 157 157 158 g_ static_mutex_unlock (&mutex);158 g_mutex_unlock (&mutex); 159 159 return ret; 160 160 } 161 161 #else -
modules/sftp-method.c
old new 1488 1488 invoke_save_auth (uri, keyring, user_name, object, authtype, password); 1489 1489 } 1490 1490 1491 if (!g_thread_supported ()) g_thread_init (NULL);1492 1493 1491 *connection = g_new0 (SftpConnection, 1); 1494 1492 (*connection)->ref_count = 1; 1495 1493 (*connection)->in_fd = in_fd;