#define ERR_CHANNEL_INTERP_CLOSED -4
#define ERR_CHANNEL_EMPTY -5
#define ERR_CHANNEL_NOT_EMPTY -6
-#define ERR_CHANNEL_MUTEX_INIT -7
+#define ERR_CHANNEL_MUTEX_INIT -7 // currently unused
#define ERR_CHANNELS_MUTEX_INIT -8
#define ERR_NO_NEXT_CHANNEL_ID -9
#define ERR_CHANNEL_CLOSED_WAITING -10
"if not empty (try force=True)",
cid);
}
- else if (err == ERR_CHANNEL_MUTEX_INIT) {
- PyErr_SetString(state->ChannelError,
- "can't initialize mutex for new channel");
- }
else if (err == ERR_CHANNELS_MUTEX_INIT) {
PyErr_SetString(state->ChannelError,
"can't initialize mutex for channel management");
{
PyThread_type_lock mutex = PyThread_allocate_lock();
if (mutex == NULL) {
- return ERR_CHANNEL_MUTEX_INIT;
+ PyErr_NoMemory();
+ return -1;
}
_channel_state *chan = _channel_new(mutex, defaults);
if (chan == NULL) {
int64_t cid = channel_create(&_globals.channels, defaults);
if (cid < 0) {
- (void)handle_channel_error(-1, self, cid);
+ (void)handle_channel_error(cid, self, cid);
return NULL;
}
module_state *state = get_module_state(self);