summaryrefslogtreecommitdiff
path: root/Python/thread_pthread.h
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-12-19 16:28:04 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2013-12-19 16:28:04 +0200
commit4227b17d9339bf04d5bc1af4a589eabaaa46703c (patch)
tree956667b1fe56f0c11ec7af6c85345a88e4be796e /Python/thread_pthread.h
parent65ab1a2a0f28cdc19d18a84dcccbe18fdf15d858 (diff)
parentb283473939e00f8ee3b773edf64b4c0098ff2e38 (diff)
downloadcpython-4227b17d9339bf04d5bc1af4a589eabaaa46703c.tar.gz
Issue #18829: csv.Dialect() now checks type for delimiter, escapechar and
quotechar fields. Original patch by Vajrasky Kok.
Diffstat (limited to 'Python/thread_pthread.h')
-rw-r--r--Python/thread_pthread.h15
1 files changed, 6 insertions, 9 deletions
diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h
index e90ae7e5b9..d9f7c76f2a 100644
--- a/Python/thread_pthread.h
+++ b/Python/thread_pthread.h
@@ -282,14 +282,14 @@ PyThread_allocate_lock(void)
if (!initialized)
PyThread_init_thread();
- lock = (sem_t *)malloc(sizeof(sem_t));
+ lock = (sem_t *)PyMem_RawMalloc(sizeof(sem_t));
if (lock) {
status = sem_init(lock,0,1);
CHECK_STATUS("sem_init");
if (error) {
- free((void *)lock);
+ PyMem_RawFree((void *)lock);
lock = NULL;
}
}
@@ -313,7 +313,7 @@ PyThread_free_lock(PyThread_type_lock lock)
status = sem_destroy(thelock);
CHECK_STATUS("sem_destroy");
- free((void *)thelock);
+ PyMem_RawFree((void *)thelock);
}
/*
@@ -410,7 +410,7 @@ PyThread_allocate_lock(void)
if (!initialized)
PyThread_init_thread();
- lock = (pthread_lock *) malloc(sizeof(pthread_lock));
+ lock = (pthread_lock *) PyMem_RawMalloc(sizeof(pthread_lock));
if (lock) {
memset((void *)lock, '\0', sizeof(pthread_lock));
lock->locked = 0;
@@ -430,7 +430,7 @@ PyThread_allocate_lock(void)
CHECK_STATUS("pthread_cond_init");
if (error) {
- free((void *)lock);
+ PyMem_RawFree((void *)lock);
lock = 0;
}
}
@@ -457,7 +457,7 @@ PyThread_free_lock(PyThread_type_lock lock)
status = pthread_mutex_destroy( &thelock->mut );
CHECK_STATUS("pthread_mutex_destroy");
- free((void *)thelock);
+ PyMem_RawFree((void *)thelock);
}
PyLockStatus
@@ -627,9 +627,6 @@ int
PyThread_set_key_value(int key, void *value)
{
int fail;
- void *oldValue = pthread_getspecific(key);
- if (oldValue != NULL)
- return 0;
fail = pthread_setspecific(key, value);
return fail ? -1 : 0;
}