perl-Skinny: don't launch thread if socket can't be created
This commit is contained in:
parent
74e14f0dfb
commit
bd6f7e73c0
|
@ -31,8 +31,10 @@ sub new {
|
||||||
$kept_self = shift->SUPER::new(@_);
|
$kept_self = shift->SUPER::new(@_);
|
||||||
$messages_send_queue = Thread::Queue->new();
|
$messages_send_queue = Thread::Queue->new();
|
||||||
$messages_receive_queue = Thread::Queue->new();
|
$messages_receive_queue = Thread::Queue->new();
|
||||||
|
if ($kept_self) {
|
||||||
threads->create(\&send_messages_thread_func);
|
threads->create(\&send_messages_thread_func);
|
||||||
threads->create(\&receive_messages_thread_func);
|
threads->create(\&receive_messages_thread_func);
|
||||||
|
}
|
||||||
return $kept_self;
|
return $kept_self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue