ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libcoro/coro.c
(Generate patch)

Comparing libcoro/coro.c (file contents):
Revision 1.68 by root, Sun Mar 6 06:26:21 2016 UTC vs.
Revision 1.72 by root, Tue Aug 14 14:25:10 2018 UTC

88 volatile void *arg = coro_init_arg; 88 volatile void *arg = coro_init_arg;
89 89
90 coro_transfer (new_coro, create_coro); 90 coro_transfer (new_coro, create_coro);
91 91
92#if __GCC_HAVE_DWARF2_CFI_ASM && __amd64 92#if __GCC_HAVE_DWARF2_CFI_ASM && __amd64
93 /*asm (".cfi_startproc");*/
93 asm (".cfi_undefined rip"); 94 /*asm (".cfi_undefined rip");*/
94#endif 95#endif
95 96
96 func ((void *)arg); 97 func ((void *)arg);
98
99#if __GCC_HAVE_DWARF2_CFI_ASM && __amd64
100 /*asm (".cfi_endproc");*/
101#endif
97 102
98 /* the new coro returned. bad. just abort() for now */ 103 /* the new coro returned. bad. just abort() for now */
99 abort (); 104 abort ();
100} 105}
101 106
118# if CORO_ASM 123# if CORO_ASM
119 124
120 #if __arm__ && \ 125 #if __arm__ && \
121 (defined __ARM_ARCH_7__ || defined __ARM_ARCH_7A__ \ 126 (defined __ARM_ARCH_7__ || defined __ARM_ARCH_7A__ \
122 || defined __ARM_ARCH_7R__ || defined __ARM_ARCH_7M__ \ 127 || defined __ARM_ARCH_7R__ || defined __ARM_ARCH_7M__ \
123 || __ARCH_ARCH == 7) 128 || __ARM_ARCH == 7)
124 #define CORO_ARM 1 129 #define CORO_ARM 1
125 #endif 130 #endif
126 131
127 #if _WIN32 || __CYGWIN__ 132 #if _WIN32 || __CYGWIN__
128 #define CORO_WIN_TIB 1 133 #define CORO_WIN_TIB 1
589coro_destroy (coro_context *ctx) 594coro_destroy (coro_context *ctx)
590{ 595{
591 if (!pthread_equal (ctx->id, null_tid)) 596 if (!pthread_equal (ctx->id, null_tid))
592 { 597 {
593 pthread_cancel (ctx->id); 598 pthread_cancel (ctx->id);
594 pthread_mutex_unlock (&coro_mutex); 599 pthread_mutex_unlock (&coro_mutex); /* let the other coro run */
595 pthread_join (ctx->id, 0); 600 pthread_join (ctx->id, 0);
596 pthread_mutex_lock (&coro_mutex); 601 pthread_mutex_lock (&coro_mutex);
597 } 602 }
598 603
599 pthread_cond_destroy (&ctx->cv); 604 pthread_cond_destroy (&ctx->cv);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines