- Timestamp:
- Oct 29, 2012, 11:04:56 PM (12 years ago)
- Branches:
- master, release-1.10
- Children:
- cb124fc6
- Parents:
- 9b3167b
- git-author:
- Anders Kaseorg <andersk@mit.edu> (06/26/12 01:54:16)
- git-committer:
- Anders Kaseorg <andersk@mit.edu> (10/29/12 23:04:56)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
global.c
r219f52c rc748e8a 899 899 } 900 900 901 static GMutex *owl_global_get_interrupt_lock(owl_global *g) 902 { 903 return g->interrupt_lock; 904 } 905 901 906 void owl_global_add_interrupt(owl_global *g) { 902 907 /* TODO: This can almost certainly be done with atomic 903 908 * operations. Whatever. */ 904 g_mutex_lock( g->interrupt_lock);909 g_mutex_lock(owl_global_get_interrupt_lock(g)); 905 910 g->interrupt_count++; 906 g_mutex_unlock( g->interrupt_lock);911 g_mutex_unlock(owl_global_get_interrupt_lock(g)); 907 912 } 908 913 909 914 bool owl_global_take_interrupt(owl_global *g) { 910 915 bool ans = false; 911 g_mutex_lock( g->interrupt_lock);916 g_mutex_lock(owl_global_get_interrupt_lock(g)); 912 917 if (g->interrupt_count > 0) { 913 918 ans = true; 914 919 g->interrupt_count--; 915 920 } 916 g_mutex_unlock( g->interrupt_lock);921 g_mutex_unlock(owl_global_get_interrupt_lock(g)); 917 922 return ans; 918 923 }
Note: See TracChangeset
for help on using the changeset viewer.