From 8b369f263f10de056c3633806a7f1ed87e2b7145 Mon Sep 17 00:00:00 2001 From: "Michael J. Chudobiak" Date: Wed, 17 Oct 2012 08:15:39 -0400 Subject: init threading properly, added more mutex locks --- flash.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'flash.c') diff --git a/flash.c b/flash.c index 5228bc5..7fd5bb8 100644 --- a/flash.c +++ b/flash.c @@ -295,9 +295,8 @@ void writeUserBlock(FlashStruct *mem, int addr, int numbytes) // *** that the main file is valid before backing it up I guess... *** // *** but I don't think this situation should arise. *** - static GMutex mutex; - - g_mutex_lock (&mutex); + static GStaticMutex mutex = G_STATIC_MUTEX_INIT; + g_static_mutex_lock (&mutex); if (!globals.Flags.flash_writes_suspended) { @@ -325,7 +324,7 @@ void writeUserBlock(FlashStruct *mem, int addr, int numbytes) } } - g_mutex_unlock (&mutex); + g_static_mutex_unlock (&mutex); } -- cgit