ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/EV-Loop-Async/Async.xs
(Generate patch)

Comparing cvsroot/EV-Loop-Async/Async.xs (file contents):
Revision 1.3 by root, Tue Jul 14 15:09:44 2009 UTC vs.
Revision 1.4 by root, Tue Jul 14 15:53:43 2009 UTC

185 struct ev_loop *loop = (struct ev_loop *)SvIVX (SvRV (loop_)); 185 struct ev_loop *loop = (struct ev_loop *)SvIVX (SvRV (loop_));
186 udat *u = ev_userdata (loop); 186 udat *u = ev_userdata (loop);
187 187
188 if (u) 188 if (u)
189 { 189 {
190 pthread_cancel (u->tid);
191 ev_async_send (loop, &u->async_w);
192 pthread_join (u->tid, 0);
190 X_LOCK (u->lock); 193 X_LOCK (u->lock);
191 /* now thread is either in l_invoke, or around the blocking syscall */
192 pthread_cancel (u->tid);
193 pthread_join (u->tid, 0);
194 ev_async_send (loop, &u->async_w);
195 ev_async_stop (loop, &u->async_w); 194 ev_async_stop (loop, &u->async_w);
196 pthread_mutex_destroy (&u->lock); 195 pthread_mutex_destroy (&u->lock);
197 pthread_cond_destroy (&u->invoke_cv); 196 pthread_cond_destroy (&u->invoke_cv);
198 pthread_mutex_destroy (&u->invoke_mutex); /* TODO: locked by another thread... */ 197 pthread_mutex_destroy (&u->invoke_mutex); /* TODO: locked by another thread... */
199 SvREFCNT_dec (u->interrupt); 198 SvREFCNT_dec (u->interrupt);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines