Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
osv
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
Service Desk
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
Verlässliche Systemsoftware
projects
osv
Commits
867665ac
Commit
867665ac
authored
12 years ago
by
Christoph Hellwig
Browse files
Options
Downloads
Patches
Plain Diff
enable locking in libc
parent
2771d43f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
libc/build.mak
+0
-1
0 additions, 1 deletion
libc/build.mak
libc/internal/__lock.c
+0
-10
0 additions, 10 deletions
libc/internal/__lock.c
libc/internal/libc.h
+4
-5
4 additions, 5 deletions
libc/internal/libc.h
libc/time/tzset.c
+2
-1
2 additions, 1 deletion
libc/time/tzset.c
with
6 additions
and
17 deletions
libc/build.mak
+
0
−
1
View file @
867665ac
...
...
@@ -3,7 +3,6 @@ libc :=
libc
+=
internal/floatscan.o
libc
+=
internal/intscan.o
libc
+=
internal/libc.o
libc
+=
internal/__lock.o
libc
+=
internal/shgetc.o
libc
+=
ctype/__ctype_get_mb_cur_max.o
...
...
This diff is collapsed.
Click to expand it.
libc/internal/__lock.c
deleted
100644 → 0
+
0
−
10
View file @
2771d43f
#include
"libc.h"
void
__lock
(
volatile
int
*
l
)
{
}
void
__unlock
(
volatile
int
*
l
)
{
}
This diff is collapsed.
Click to expand it.
libc/internal/libc.h
+
4
−
5
View file @
867665ac
...
...
@@ -2,6 +2,7 @@
#define LIBC_H
#include
<stdlib.h>
#include
<osv/mutex.h>
#include
"stdio.h"
/* as long as we use the glibc header we'll need this hack */
...
...
@@ -20,7 +21,7 @@ struct __libc {
volatile
int
threads_minus_1
;
// int canceldisable;
FILE
*
ofl_head
;
in
t
ofl_lock
[
2
]
;
mutex_
t
ofl_lock
;
// size_t tls_size;
};
...
...
@@ -30,12 +31,10 @@ extern struct __libc __libc ATTR_LIBC_VISIBILITY;
#define libc __libc
/* Designed to avoid any overhead in non-threaded processes */
void
__lock
(
volatile
int
*
)
ATTR_LIBC_VISIBILITY
;
void
__unlock
(
volatile
int
*
)
ATTR_LIBC_VISIBILITY
;
int
__lockfile
(
FILE
*
)
ATTR_LIBC_VISIBILITY
;
void
__unlockfile
(
FILE
*
)
ATTR_LIBC_VISIBILITY
;
#define LOCK(x) (libc.threads_minus_1 ? (
_
_lock(
x
),1) : ((void)(x),1))
#define UNLOCK(x) (libc.threads_minus_1 ? (
_
_unlock(
x
),1) : ((void)(x),1))
#define LOCK(x) (libc.threads_minus_1 ? (
mutex
_lock(
&(x)
),1) : ((void)(x),1))
#define UNLOCK(x) (libc.threads_minus_1 ? (
mutex
_unlock(
&(x)
),1) : ((void)(x),1))
extern
char
**
__environ
;
#define environ __environ
...
...
This diff is collapsed.
Click to expand it.
libc/time/tzset.c
+
2
−
1
View file @
867665ac
...
...
@@ -108,7 +108,8 @@ void tzset(void)
void
__tzset
(
void
)
{
static
int
lock
[
2
],
init
;
static
mutex_t
lock
;
static
int
init
;
if
(
init
)
return
;
LOCK
(
lock
);
if
(
!
init
)
tzset
();
...
...
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