Age | Commit message (Collapse) | Author | |
---|---|---|---|
2024-02-09 | Clean up Windows-specific mutex code in libpq and ecpglib. | Tom Lane | |
Fix pthread-win32.h and pthread-win32.c to provide a more complete emulation of POSIX pthread mutexes: define PTHREAD_MUTEX_INITIALIZER and make sure that pthread_mutex_lock() can operate on a mutex object that's been initialized that way. Then we don't need the duplicative platform-specific logic in default_threadlock() and pgtls_init(), which we'd otherwise need yet a third copy of for an upcoming bug fix. Also, since default_threadlock() supposes that pthread_mutex_lock() cannot fail, try to ensure that that's actually true, by getting rid of the malloc call that was formerly involved in initializing an emulated mutex. We can define an extra state for the spinlock field instead. Also, replace the similar code in ecpglib/misc.c with this version. While ecpglib's version at least had a POSIX-compliant API, it also had the potential of failing during mutex init (but here, because of CreateMutex failure rather than malloc failure). Since all of misc.c's callers ignore failures, it seems like a wise idea to avoid failures here too. A further improvement in this area could be to unify libpq's and ecpglib's implementations into a src/port/pthread-win32.c file. But that doesn't seem like a bug fix, so I'll desist for now. In preparation for the aforementioned bug fix, back-patch to all supported branches. Discussion: https://postgr.es/m/264860.1707163416@sss.pgh.pa.us | |||
2010-09-20 | Remove cvs keywords from all files. | Magnus Hagander | |
2009-06-11 | 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list | Bruce Momjian | |
provided by Andrew. | |||
2008-05-21 | Use CRITICAL_SECTION instead of Mutexes for thread-locking in libpq on | Magnus Hagander | |
Windows, for better performance. Per suggestion from Andrew Chernow, but not his patch since the underlying code was changed to deal with return values. | |||
2008-05-17 | Add $PostgreSQL$ markers to a lot of files that were missing them. | Andrew Dunstan | |
This particular batch was just for *.c and *.h file. The changes were made with the following 2 commands: find . \( \( -name 'libstemmer' -o -name 'expected' -o -name 'ppport.h' \) -prune \) -o \( -name '*.[ch]' \) \( -exec grep -q '\$PostgreSQL' {} \; -o -print \) | while read file ; do head -n 1 < $file | grep -q '^/\*' && echo $file; done | xargs -l sed -i -e '1s/^\// /' -e '1i/*\n * $PostgreSQL:$ \n *' find . \( \( -name 'libstemmer' -o -name 'expected' -o -name 'ppport.h' \) -prune \) -o \( -name '*.[ch]' \) \( -exec grep -q '\$PostgreSQL' {} \; -o -print \) | xargs -l sed -i -e '1i/*\n * $PostgreSQL:$ \n */' | |||
2008-05-16 | Fix declarations of pthread functions, missed in recent commit. | Tom Lane | |
2007-04-18 | Silence mingw compiler warning | Magnus Hagander | |
2006-07-10 | Move pthread-win32.h to /port, modify bcc/msvc makefiles. | Bruce Momjian | |