- Timestamp:
- May 23, 2011, 8:57:46 PM (12 years ago)
- Branches:
- master, release-1.8, release-1.9
- Children:
- 6bd485e
- Parents:
- 1491439
- git-author:
- David Benjamin <davidben@mit.edu> (02/26/11 14:38:04)
- git-committer:
- David Benjamin <davidben@mit.edu> (05/23/11 20:57:46)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
global.c
r257b9c4 r47128d9 112 112 g->timerlist = NULL; 113 113 g->kill_buffer = NULL; 114 115 g->interrupt_count = 0; 116 g->interrupt_lock = g_mutex_new(); 114 117 } 115 118 … … 924 927 g->kill_buffer = g_strndup(kill, len); 925 928 } 929 930 void owl_global_add_interrupt(owl_global *g) { 931 /* TODO: This can almost certainly be done with atomic 932 * operations. Whatever. */ 933 g_mutex_lock(g->interrupt_lock); 934 g->interrupt_count++; 935 g_mutex_unlock(g->interrupt_lock); 936 } 937 938 bool owl_global_take_interrupt(owl_global *g) { 939 bool ans = false; 940 g_mutex_lock(g->interrupt_lock); 941 if (g->interrupt_count > 0) { 942 ans = true; 943 g->interrupt_count--; 944 } 945 g_mutex_unlock(g->interrupt_lock); 946 return ans; 947 }
Note: See TracChangeset
for help on using the changeset viewer.