summaryrefslogtreecommitdiff
path: root/flash.c
diff options
context:
space:
mode:
authorMichael J. Chudobiak <mjc@avtechpulse.com>2012-10-17 08:15:39 -0400
committerMichael J. Chudobiak <mjc@avtechpulse.com>2012-10-17 08:15:39 -0400
commit8b369f263f10de056c3633806a7f1ed87e2b7145 (patch)
tree8a0d9c4ed35663da416abb08412eb0aa920ba697 /flash.c
parentb4a429729774f91ff259fe17d256b00134bc9f1f (diff)
init threading properly, added more mutex locks
Diffstat (limited to 'flash.c')
-rw-r--r--flash.c7
1 files changed, 3 insertions, 4 deletions
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);
}