-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix usage of lockAPI #13
Conversation
@@ -81,7 +81,9 @@ subroutines are required for linking multi-threaded applications. | |||
|
|||
/* dummy lock routines and static locks for single-threaded apps */ | |||
|
|||
#ifndef __SINGLE_THREAD__ | |||
#include <newlib.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to include newlib.h
otherwise you don't have access to the defined macros like __SINGLE_THREAD__
#ifndef __SINGLE_THREAD__ | ||
#include <newlib.h> | ||
|
||
#if defined(__SINGLE_THREAD__) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually a bug.
These are the dummy implementation if user selected _RETARGETABLE_LOCKING
but it is still a SINGLE_THREAD
configuration.
@@ -8,6 +8,7 @@ typedef struct __dirdesc { | |||
char *dd_buf; /* buffer */ | |||
int dd_len; /* buffer length */ | |||
int dd_size; /* amount of data in buffer */ | |||
void *dd_lock; /* lock */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needed for HAVE_DD_LOCK
To have thread-safe operations for all the
newlib
operations we have been required to do several PR:newlib
ps2toolchain-ee
ps2sdk
This PR skips the usage of the dummy lock API, letting us implement the specific one in the
ps2sdk/libcglue