Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(18)

Side by Side Diff: Modules/_multiprocessing/semaphore.c

Issue 27591: multiprocessing: Possible uninitialized pointer use in Windows builds
Patch Set: Created 3 years, 6 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * A type which wraps a semaphore 2 * A type which wraps a semaphore
3 * 3 *
4 * semaphore.c 4 * semaphore.c
5 * 5 *
6 * Copyright (c) 2006-2008, R Oudkerk 6 * Copyright (c) 2006-2008, R Oudkerk
7 * Licensed to PSF under a Contributor Agreement. 7 * Licensed to PSF under a Contributor Agreement.
8 */ 8 */
9 9
10 #include "multiprocessing.h" 10 #include "multiprocessing.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 Py_RETURN_TRUE; 106 Py_RETURN_TRUE;
107 } 107 }
108 108
109 /* prepare list of handles */ 109 /* prepare list of handles */
110 nhandles = 0; 110 nhandles = 0;
111 handles[nhandles++] = self->handle; 111 handles[nhandles++] = self->handle;
112 if (_PyOS_IsMainThread()) { 112 if (_PyOS_IsMainThread()) {
113 sigint_event = _PyOS_SigintEvent(); 113 sigint_event = _PyOS_SigintEvent();
114 assert(sigint_event != NULL); 114 assert(sigint_event != NULL);
115 handles[nhandles++] = sigint_event; 115 handles[nhandles++] = sigint_event;
116 } else {
haypo 2016/07/23 02:06:33 PEP 7: } else {
117 sigint_event = NULL;
116 } 118 }
117 119
118 /* do the wait */ 120 /* do the wait */
119 Py_BEGIN_ALLOW_THREADS 121 Py_BEGIN_ALLOW_THREADS
120 if (sigint_event != NULL) 122 if (sigint_event != NULL)
121 ResetEvent(sigint_event); 123 ResetEvent(sigint_event);
122 res = WaitForMultipleObjectsEx(nhandles, handles, FALSE, full_msecs, FALSE); 124 res = WaitForMultipleObjectsEx(nhandles, handles, FALSE, full_msecs, FALSE);
123 Py_END_ALLOW_THREADS 125 Py_END_ALLOW_THREADS
124 126
125 /* handle result */ 127 /* handle result */
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 if (!PyArg_ParseTuple(args, "s", &name)) 666 if (!PyArg_ParseTuple(args, "s", &name))
665 return NULL; 667 return NULL;
666 668
667 if (SEM_UNLINK(name) < 0) { 669 if (SEM_UNLINK(name) < 0) {
668 _PyMp_SetError(NULL, MP_STANDARD_ERROR); 670 _PyMp_SetError(NULL, MP_STANDARD_ERROR);
669 return NULL; 671 return NULL;
670 } 672 }
671 673
672 Py_RETURN_NONE; 674 Py_RETURN_NONE;
673 } 675 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+