fix false ownership of stdio FILEs due to tid reuse
this is analogous commit fffc5cda10
which fixed the corresponding issue for mutexes.
the robust list can't be used here because the locks do not share a
common layout with mutexes. at some point it may make sense to simply
incorporate a mutex object into the FILE structure and use it, but
that would be a much more invasive change, and it doesn't mesh well
with the current design that uses a simpler code path for internal
locking and pulls in the recursive-mutex-like code when the flockfile
API is used explicitly.
This commit is contained in:
@@ -44,6 +44,7 @@ struct pthread {
|
||||
int exitlock[2];
|
||||
int startlock[2];
|
||||
unsigned long sigmask[_NSIG/8/sizeof(long)];
|
||||
void *stdio_locks;
|
||||
};
|
||||
|
||||
struct __timer {
|
||||
|
||||
@@ -46,6 +46,7 @@ struct _IO_FILE {
|
||||
void *mustbezero_2;
|
||||
unsigned char *shend;
|
||||
off_t shlim, shcnt;
|
||||
FILE *prev_locked, *next_locked;
|
||||
};
|
||||
|
||||
size_t __stdio_read(FILE *, unsigned char *, size_t);
|
||||
|
||||
Reference in New Issue
Block a user