Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
b4e6d685
Commit
b4e6d685
authored
4 years ago
by
Deucе
Browse files
Options
Downloads
Patches
Plain Diff
#define protected_*_value(val) atomic_load(&val)
parent
5b0b565e
No related branches found
No related tags found
1 merge request
!463
MRC mods by Codefenix (2024-10-20)
Pipeline
#1357
passed
4 years ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/xpdev/threadwrap.h
+9
-4
9 additions, 4 deletions
src/xpdev/threadwrap.h
with
9 additions
and
4 deletions
src/xpdev/threadwrap.h
+
9
−
4
View file @
b4e6d685
...
...
@@ -173,6 +173,11 @@ typedef _Atomic(uint64_t) protected_uint64_t;
DLLEXPORT
int
DLLCALL
protected_uint32_init
(
protected_uint32_t
*
,
uint32_t
value
);
DLLEXPORT
int
DLLCALL
protected_uint64_init
(
protected_uint64_t
*
,
uint64_t
value
);
#define protected_int32_value(val) atomic_load(&val)
#define protected_uint32_value(val) atomic_load(&val)
#define protected_int64_value(val) atomic_load(&val)
#define protected_uint64_value(val) atomic_load(&val)
#define protected_int32_destroy(i) 0
#define protected_uint32_destroy(i) 0
#define protected_int64_destroy(i) 0
...
...
@@ -205,6 +210,10 @@ typedef struct {
#define protected_uint32_destroy protected_int32_destroy
#define protected_int64_destroy protected_int32_destroy
#define protected_uint64_destroy protected_int32_destroy
#define protected_int32_value(i) protected_int32_adjust(&i,0)
#define protected_uint32_value(i) protected_uint32_adjust(&i,0)
#define protected_int64_value(i) protected_int64_adjust(&i,0)
#define protected_uint64_value(i) protected_uint64_adjust(&i,0)
#endif
/* Return 0 on success, non-zero on failure (see pthread_mutex_init): */
...
...
@@ -214,16 +223,12 @@ DLLEXPORT int DLLCALL protected_int64_init(protected_int64_t*, int64_t value);
/* Return new value: */
DLLEXPORT
int32_t
DLLCALL
protected_int32_adjust
(
protected_int32_t
*
,
int32_t
adjustment
);
DLLEXPORT
int32_t
DLLCALL
protected_int32_set
(
protected_int32_t
*
,
int32_t
val
);
#define protected_int32_value(i) protected_int32_adjust(&i,0)
DLLEXPORT
uint32_t
DLLCALL
protected_uint32_adjust
(
protected_uint32_t
*
,
int32_t
adjustment
);
DLLEXPORT
uint32_t
DLLCALL
protected_uint32_set
(
protected_uint32_t
*
,
uint32_t
val
);
#define protected_uint32_value(i) protected_uint32_adjust(&i,0)
DLLEXPORT
int64_t
DLLCALL
protected_int64_adjust
(
protected_int64_t
*
,
int64_t
adjustment
);
DLLEXPORT
int64_t
DLLCALL
protected_int64_set
(
protected_int64_t
*
,
int64_t
val
);
#define protected_int64_value(i) protected_int64_adjust(&i,0)
DLLEXPORT
uint64_t
DLLCALL
protected_uint64_adjust
(
protected_uint64_t
*
,
int64_t
adjustment
);
DLLEXPORT
uint64_t
DLLCALL
protected_uint64_set
(
protected_uint64_t
*
,
uint64_t
adjustment
);
#define protected_uint64_value(i) protected_uint64_adjust(&i,0)
#if defined(__cplusplus)
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment