Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | make internal declarations for flockfile tracking functions checkable | Rich Felker | 2018-09-12 | 1 | -2/+0 |
| | | | | | | | logically these belong to the intersection of the stdio and pthread subsystems, and either place the declarations could go (stdio_impl.h or pthread_impl.h) requires a forward declaration for one of the argument types. | ||||
* | fix false ownership of stdio FILEs due to tid reuse | Rich Felker | 2014-08-23 | 1 | -1/+9 |
| | | | | | | | | | | | | | this is analogous commit fffc5cda10e0c5c910b40f7be0d4fa4e15bb3f48 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. | ||||
* | add proper fuxed-based locking for stdio | Rich Felker | 2011-07-30 | 1 | -1/+1 |
| | | | | | | | | | | | | | | | | | | | | | | previously, stdio used spinlocks, which would be unacceptable if we ever add support for thread priorities, and which yielded pathologically bad performance if an application attempted to use flockfile on a key file as a major/primary locking mechanism. i had held off on making this change for fear that it would hurt performance in the non-threaded case, but actually support for recursive locking had already inflicted that cost. by having the internal locking functions store a flag indicating whether they need to perform unlocking, rather than using the actual recursive lock counter, i was able to combine the conditionals at unlock time, eliminating any additional cost, and also avoid a nasty corner case where a huge number of calls to ftrylockfile could cause deadlock later at the point of internal locking. this commit also fixes some issues with usage of pthread_self conflicting with __attribute__((const)) which resulted in crashes with some compiler versions/optimizations, mainly in flockfile prior to pthread_create. | ||||
* | implement flockfile api, rework stdio locking | Rich Felker | 2011-03-12 | 1 | -0/+7 |