-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tidy and improve code for session discovery
1. Add brackets round if bodies. 2. Use common os_calls/thread_calls functions where available and add new ones for: g_file_seek_rel_end() g_map_file_shared() g_unmap_file_shared() g_sleep_secs() [because usleep() can error for argument >= 1M] g_ftruncate() tc_mutex_timed_lock() tc_shared_mutex_create() 3. Separate declarations and initialisations. 4. Make macros for sesshm_try_lock() etc cleaner. Also some minor bugfixes: 1. Fix bug in sesshm_try_lock() which begins "return 0". 2. The return value of pthread_mutex_init() in sesshm_create_new_shm() was ignored. (No longer relevant because tc_shared_mutex_create() is now used.) 3. sesshm_map() set g_shm_mapping and returned a value. (No longer relevant because using g_map_file_shared() it is simple enough not to need a function.)
- Loading branch information
Showing
5 changed files
with
253 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.