aboutsummaryrefslogtreecommitdiff
path: root/src/backend/port/win32/signal.c
Commit message (Collapse)AuthorAge
* Fix latent portability issue in pgwin32_dispatch_queued_signals().Tom Lane2016-04-04
| | | | | | | | | | | | | | | | The first iteration of the signal-checking loop would compute sigmask(0) which expands to 1<<(-1) which is undefined behavior according to the C standard. The lack of field reports of trouble suggest that it evaluates to 0 on all existing Windows compilers, but that's hardly something to rely on. Since signal 0 isn't a queueable signal anyway, we can just make the loop iterate from 1 instead, and save a few cycles as well as avoiding the undefined behavior. In passing, avoid evaluating the volatile expression UNBLOCKED_SIGNAL_QUEUE twice in a row; there's no reason to waste cycles like that. Noted by Aleksander Alekseev, though this isn't his proposed fix. Back-patch to all supported branches.
* Update copyright for 2016Bruce Momjian2016-01-02
| | | | Backpatch certain files through 9.1
* Update copyright for 2015Bruce Momjian2015-01-06
| | | | Backpatch certain files through 9.0
* Update copyright for 2014Bruce Momjian2014-01-07
| | | | | Update all files in head, and files COPYRIGHT and legal.sgml in all back branches.
* Move pqsignal() to libpgport.Tom Lane2013-03-17
| | | | | | | | | We had two copies of this function in the backend and libpq, which was already pretty bogus, but it turns out that we need it in some other programs that don't use libpq (such as pg_test_fsync). So put it where it probably should have been all along. The signal-mask-initialization support in src/backend/libpq/pqsignal.c stays where it is, though, since we only need that in the backend.
* Update copyrights for 2013Bruce Momjian2013-01-01
| | | | | Fully update git head, and update back branches in ./COPYRIGHT and legal.sgml files.
* Update copyright notices for year 2012.Bruce Momjian2012-01-01
|
* Use consistent format for reporting GetLastError()Peter Eisentraut2011-08-23
| | | | | | Use something like "error code %lu" for reporting GetLastError() values on Windows. Previously, a mix of different wordings and formats were in use.
* Message style improvements of errmsg_internal() callsPeter Eisentraut2011-07-05
|
* Capitalization fixesPeter Eisentraut2011-06-19
|
* Stamp copyrights for year 2011.Bruce Momjian2011-01-01
|
* Remove cvs keywords from all files.Magnus Hagander2010-09-20
|
* pgindent run for 9.0Bruce Momjian2010-02-26
|
* Fix race condition in win32 signal handling.Magnus Hagander2010-01-31
| | | | | | | | | | | | There was a race condition where the receiving pipe could be closed by the child thread if the main thread was pre-empted before it got a chance to create a new one, and the dispatch thread ran to completion during that time. One symptom of this is that rows in pg_listener could be dropped under heavy load. Analysis and original patch by Radu Ilie, with some small modifications by Magnus Hagander.
* Update copyright for the year 2010.Bruce Momjian2010-01-02
|
* Update copyright for 2009.Bruce Momjian2009-01-01
|
* Fix MinGW warnings re formats and unused variables. per ITAGAKI TakahiroAndrew Dunstan2008-04-16
|
* Update copyrights in source tree to 2008.Bruce Momjian2008-01-01
|
* Use snprintf instead of wsprintf, and use getenv("APPDATA") instead ofMagnus Hagander2007-10-23
| | | | | | | | | | | | | | SHGetFolderPath. This removes the direct dependency on shell32.dll and user32.dll, which eats a lot of "desktop heap" for each backend that's started. The desktop heap is a very limited resource, causing backends to no longer start once it's been exhausted. We still have indirect depdendencies on user32.dll through third party libraries, but those can't easily be removed. Dave Page
* Update CVS HEAD for 2007 copyright. Back branches are typically notBruce Momjian2007-01-05
| | | | back-stamped for this.
* In a Windows backend, don't build src/port/pgsleep.c's version ofTom Lane2006-07-16
| | | | | | | | pg_usleep at all. Instead call the replacement function in port/win32/signal.c by that name. Avoids tricky macro-redefinition logic and suppresses a compiler warning; furthermore it ensures that no one can accidentally use the non-signal-aware version of pg_usleep in a Windows backend.
* Update copyright for 2006. Update scripts.Bruce Momjian2006-03-05
|
* Re-run pgindent, fixing a problem where comment lines after a blankBruce Momjian2005-11-22
| | | | | | | | | comment line where output as too long, and update typedefs for /lib directory. Also fix case where identifiers were used as variable names in the backend, but as typedefs in ecpg (favor the backend for indenting). Backpatch to 8.1.X.
* Fix Windows setitimer() emulation to not depend on delivering an APCTom Lane2005-10-25
| | | | | | to the main thread. This allows removal of WaitForSingleObjectEx() calls from the main thread, thereby allowing us to re-enable Qingqing Zhou's CHECK_FOR_INTERRUPTS performance improvement. Qingqing, Magnus, et al.
* Improve performance of CHECK_FOR_INTERRUPTS() macro on Windows by not doingTom Lane2005-10-21
| | | | | | | a kernel call unless there's some evidence of a pending signal. This should bring its performance on Windows into line with the Unix version. Problem diagnosis and patch by Qingqing Zhou. Minor stylistic tweaks by moi ... if it's broken, it's my fault.
* Standard pgindent run for 8.1.Bruce Momjian2005-10-15
|
* Tag appropriate files for rc3PostgreSQL Daemon2004-12-31
| | | | | | | | Also performed an initial run through of upgrading our Copyright date to extend to 2005 ... first run here was very simple ... change everything where: grep 1996-2004 && the word 'Copyright' ... scanned through the generated list with 'less' first, and after, to make sure that I only picked up the right entries ...
* Fix Win32 problems with signals and sockets, by making the forkexec codeTom Lane2004-11-17
| | | | | | even uglier than it was already :-(. Also, on Windows only, use temporary shared memory segments instead of ordinary files to pass over critical variable values from postmaster to child processes. Magnus Hagander
* Clarify some error messagesPeter Eisentraut2004-11-09
|
* Message style revisionsPeter Eisentraut2004-10-12
|
* Pgindent run for 8.0.Bruce Momjian2004-08-29
|
* Update copyright to 2004.Bruce Momjian2004-08-29
|
* Fix Windows emulation of kill(pid, 0). This will now succeed, but onlyTom Lane2004-08-27
| | | | | if the target PID is a PG postmaster or backend --- for our purposes that is actually better than the Unix behavior. Per Dave Page and Andrew Dunstan.
* Replace direct fprintf(stderr) calls by write_stderr(), and cause thisTom Lane2004-06-24
| | | | | | | routine to do something appropriate on Win32. Also, add a security check on Win32 that parallels the can't-run-as-root check on Unix. Magnus Hagander
* Cleanup for Win32 pgkill.Bruce Momjian2004-05-27
|
* Move pgkill out into /port so pg_ctl can use it on Win32.Bruce Momjian2004-05-27
|
* Here's an attempt at new socket and signal code for win32.Bruce Momjian2004-04-12
It works on the principle of turning sockets into non-blocking, and then emulate blocking behaviour on top of that, while allowing signals to run. Signals are now implemented using an event instead of APCs, thus getting rid of the issue of APCs not being compatible with "old style" sockets functions. It also moves the win32 specific code away from pqsignal.h/c into port/win32, and also removes the "thread style workaround" of the APC issue previously in place. In order to make things work, a few things are also changed in pgstat.c: 1) There is now a separate pipe to the collector and the bufferer. This is required because the pipe will otherwise only be signalled in one of the processes when the postmaster goes down. The MS winsock code for select() must have some kind of workaround for this behaviour, but I have found no stable way of doing that. You really are not supposed to use the same socket from more than one process (unless you use WSADuplicateSocket(), in which case the docs specifically say that only one will be flagged). 2) The check for "postmaster death" is moved into a separate select() call after the main loop. The previous behaviour select():ed on the postmaster pipe, while later explicitly saying "we do NOT check for postmaster exit inside the loop". The issue was that the code relies on the same select() call seeing both the postmaster pipe *and* the pgstat pipe go away. This does not always happen, and it appears that useing WSAEventSelect() makes it even more common that it does not. Since it's only called when the process exits, I don't think using a separate select() call will have any significant impact on how the stats collector works. Magnus Hagander