-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from discosat/dynamically-allocated-store
Add dynamically allocated proc store and locks
- Loading branch information
Showing
12 changed files
with
447 additions
and
77 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#ifndef CSP_PROC_MUTEX_H | ||
#define CSP_PROC_MUTEX_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#define PROC_MUTEX_OK 0 | ||
#define PROC_MUTEX_ERR 1 | ||
|
||
typedef struct proc_mutex_t proc_mutex_t; | ||
|
||
/** | ||
* Create a new mutex. | ||
* | ||
* @return A pointer to the new mutex | ||
*/ | ||
proc_mutex_t * proc_mutex_create(); | ||
|
||
/** | ||
* Take/lock mutex. | ||
* | ||
* @param mutex The mutex to take | ||
* | ||
* @return 0 on success, 1 on failure | ||
*/ | ||
int proc_mutex_take(proc_mutex_t * mutex); | ||
|
||
/** | ||
* Give/unlock mutex. | ||
* | ||
* @param mutex The mutex to give | ||
* | ||
* @return 0 on success, 1 on failure | ||
*/ | ||
int proc_mutex_give(proc_mutex_t * mutex); | ||
|
||
/** | ||
* Destroy mutex. | ||
* | ||
* @param mutex The mutex to destroy | ||
*/ | ||
void proc_mutex_destroy(proc_mutex_t * mutex); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif // CSP_PROC_MUTEX_H |
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
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.