Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
cf1474b7
Commit
cf1474b7
authored
Oct 08, 1996
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sjoerd's thread changes (including down_sema typo fix).
Note: waitflag not supported on NT.
parent
5b1d9bad
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
47 additions
and
18 deletions
+47
-18
Python/thread_cthread.h
Python/thread_cthread.h
+3
-2
Python/thread_foobar.h
Python/thread_foobar.h
+3
-2
Python/thread_lwp.h
Python/thread_lwp.h
+3
-2
Python/thread_nt.h
Python/thread_nt.h
+5
-1
Python/thread_os2.h
Python/thread_os2.h
+2
-2
Python/thread_pthread.h
Python/thread_pthread.h
+3
-2
Python/thread_sgi.h
Python/thread_sgi.h
+10
-3
Python/thread_solaris.h
Python/thread_solaris.h
+18
-4
No files found.
Python/thread_cthread.h
View file @
cf1474b7
...
...
@@ -183,10 +183,11 @@ void free_sema _P1(sema, type_sema sema)
dprintf
((
"free_sema(%lx) called
\n
"
,
(
long
)
sema
));
}
void
down_sema
_P1
(
sema
,
type_sema
sema
)
int
down_sema
_P2
(
sema
,
type_sema
sema
,
waitflag
,
int
waitflag
)
{
dprintf
((
"down_sema(%lx
) called
\n
"
,
(
long
)
sema
));
dprintf
((
"down_sema(%lx
, %d) called
\n
"
,
(
long
)
sema
,
waitflag
));
dprintf
((
"down_sema(%lx) return
\n
"
,
(
long
)
sema
));
return
-
1
;
}
void
up_sema
_P1
(
sema
,
type_sema
sema
)
...
...
Python/thread_foobar.h
View file @
cf1474b7
...
...
@@ -142,10 +142,11 @@ void free_sema _P1(sema, type_sema sema)
dprintf
((
"free_sema(%lx) called
\n
"
,
(
long
)
sema
));
}
void
down_sema
_P1
(
sema
,
type_sema
sema
)
int
down_sema
_P2
(
sema
,
type_sema
sema
,
waitflag
,
int
waitflag
)
{
dprintf
((
"down_sema(%lx
) called
\n
"
,
(
long
)
sema
));
dprintf
((
"down_sema(%lx
, %d) called
\n
"
,
(
long
)
sema
,
waitflag
));
dprintf
((
"down_sema(%lx) return
\n
"
,
(
long
)
sema
));
return
-
1
;
}
void
up_sema
_P1
(
sema
,
type_sema
sema
)
...
...
Python/thread_lwp.h
View file @
cf1474b7
...
...
@@ -190,10 +190,11 @@ void free_sema _P1(sema, type_sema sema)
dprintf
((
"free_sema(%lx) called
\n
"
,
(
long
)
sema
));
}
void
down_sema
_P1
(
sema
,
type_sema
sema
)
int
down_sema
_P2
(
sema
,
type_sema
sema
,
waitflag
,
int
waitflag
)
{
dprintf
((
"down_sema(%lx
) called
\n
"
,
(
long
)
sema
));
dprintf
((
"down_sema(%lx
, %d) called
\n
"
,
(
long
)
sema
,
waitflag
));
dprintf
((
"down_sema(%lx) return
\n
"
,
(
long
)
sema
));
return
-
1
;
}
void
up_sema
_P1
(
sema
,
type_sema
sema
)
...
...
Python/thread_nt.h
View file @
cf1474b7
...
...
@@ -223,7 +223,10 @@ void free_sema(type_sema aSemaphore)
CloseHandle
((
HANDLE
)
aSemaphore
);
}
void
down_sema
(
type_sema
aSemaphore
)
/*
XXX must do something about waitflag
*/
int
down_sema
(
type_sema
aSemaphore
,
int
waitflag
)
{
DWORD
waitResult
;
...
...
@@ -232,6 +235,7 @@ void down_sema(type_sema aSemaphore)
waitResult
=
WaitForSingleObject
(
(
HANDLE
)
aSemaphore
,
INFINITE
);
dprintf
((
"%ld: down_sema(%lx) return: %l
\n
"
,
get_thread_ident
(),(
long
)
aSemaphore
,
waitResult
));
return
0
;
}
void
up_sema
(
type_sema
aSemaphore
)
...
...
Python/thread_os2.h
View file @
cf1474b7
...
...
@@ -203,9 +203,9 @@ void free_sema(type_sema aSemaphore)
}
void
down_sema
(
type_sema
aSemaphore
)
void
down_sema
(
type_sema
aSemaphore
,
int
waitflag
)
{
return
-
1
;
}
void
up_sema
(
type_sema
aSemaphore
)
...
...
Python/thread_pthread.h
View file @
cf1474b7
...
...
@@ -274,10 +274,11 @@ void free_sema _P1(sema, type_sema sema)
dprintf
((
"free_sema(%lx) called
\n
"
,
(
long
)
sema
));
}
void
down_sema
_P1
(
sema
,
type_sema
sema
)
int
down_sema
_P2
(
sema
,
type_sema
sema
,
waitflag
,
int
waitflag
)
{
dprintf
((
"down_sema(%lx
) called
\n
"
,
(
long
)
sema
));
dprintf
((
"down_sema(%lx
, %d) called
\n
"
,
(
long
)
sema
,
waitflag
));
dprintf
((
"down_sema(%lx) return
\n
"
,
(
long
)
sema
));
return
-
1
;
}
void
up_sema
_P1
(
sema
,
type_sema
sema
)
...
...
Python/thread_sgi.h
View file @
cf1474b7
...
...
@@ -423,12 +423,19 @@ void free_sema _P1(sema, type_sema sema)
usfreesema
((
usema_t
*
)
sema
,
shared_arena
);
}
void
down_sema
_P1
(
sema
,
type_sema
sema
)
int
down_sema
_P2
(
sema
,
type_sema
sema
,
waitflag
,
int
waitflag
)
{
int
success
;
dprintf
((
"down_sema(%lx) called
\n
"
,
(
long
)
sema
));
if
(
uspsema
((
usema_t
*
)
sema
)
<
0
)
perror
(
"uspsema"
);
if
(
waitflag
)
success
=
uspsema
((
usema_t
*
)
sema
);
else
success
=
uscpsema
((
usema_t
*
)
sema
);
if
(
success
<
0
)
perror
(
waitflag
?
"uspsema"
:
"uscpsema"
);
dprintf
((
"down_sema(%lx) return
\n
"
,
(
long
)
sema
));
return
success
;
}
void
up_sema
_P1
(
sema
,
type_sema
sema
)
...
...
Python/thread_solaris.h
View file @
cf1474b7
...
...
@@ -25,6 +25,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
#include </usr/include/thread.h>
#undef _POSIX_THREADS
...
...
@@ -211,12 +212,25 @@ void free_sema _P1(sema, type_sema sema)
free
((
void
*
)
sema
);
}
void
down_sema
_P1
(
sema
,
type_sema
sema
)
int
down_sema
_P2
(
sema
,
type_sema
sema
,
waitflag
,
int
waitflag
)
{
int
success
;
dprintf
((
"down_sema(%lx) called
\n
"
,
(
long
)
sema
));
if
(
sema_wait
((
sema_t
*
)
sema
))
perror
(
"sema_wait"
);
dprintf
((
"down_sema(%lx) return
\n
"
,
(
long
)
sema
));
if
(
waitflag
)
success
=
sema_wait
((
sema_t
*
)
sema
);
else
success
=
sema_trywait
((
sema_t
*
)
sema
);
if
(
success
<
0
)
{
if
(
errno
==
EBUSY
)
success
=
0
;
else
perror
(
"sema_wait"
);
}
else
success
=
!
success
;
dprintf
((
"down_sema(%lx) return %d
\n
"
,
(
long
)
sema
,
success
));
return
success
;
}
void
up_sema
_P1
(
sema
,
type_sema
sema
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment