summaryrefslogtreecommitdiff
path: root/gtk/coroutine_ucontext.c
AgeCommit message (Collapse)AuthorFilesLines
2015-06-08Move gtk/ -> src/Marc-André Lureau1-150/+0
For historical reasons, the code was placed under gtk/ subdirectory. If it was always bugging you, bug no more!
2014-10-30Always use #include "config.h"Christophe Fergeau1-1/+1
gnulib 'make syntax-check' prohibits use of #ifdef HAVE_CONFIG_H so this commit removes it from where it's used. It also makes sure we always use the same syntax for including config.h (#include "config.h" VS #include <config.h>) as a consistent way of doing that is expected.
2013-11-20coroutine: replace IN_MAIN_CONTEXT macroMarc-André Lureau1-1/+1
Use a nicer function, with correct prefix. Remove extra "context" from function name
2013-11-20coroutine: error out on OOM or impossible conditionsMarc-André Lureau1-13/+5
Take an approach similar to gthreads, which are considered as low level/must work features by glib, which aborts on failures.
2013-11-18Fix leak of mmapped memory when cc_init() failsChristophe Fergeau1-1/+10
2013-11-18Free coroutine stack when releasing coroutineDaniel P. Berrange1-0/+2
The coroutine_init function mmap's a stack for the ucontext coroutine, but nothing ever munmaps it. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-11-18Abort if mmap of coroutine stack failsDaniel P. Berrange1-1/+4
If we fail to mmap the stack, abort the processs rather than returning an error. This is standard practice in glib apps, and the caller was not checking the coroutine_init() return code leading to memory corruption. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-11-18Fix IN_MAIN_CONTEXT when using coroutine=gthreadChristophe Fergeau1-0/+5
The IN_MAIN_CONTEXT macro checks coroutine_self()->caller against NULL to decide whether we are in the main context or not. However, this is an implementation detail of the ucontext coroutine implementation, in the gthread implementation, coroutine_self()->caller will be non-NULL even in the main context. This commit introduces a coroutine_is_main_context() method which each coroutine backend implements. It turns out it can be implemented the same way for each backend.
2013-11-18coroutine: fix current coroutineMarc-André Lureau1-1/+1
When leaving a coroutine, it swaps back to where it came from, not to the leader/main coroutine.
2013-11-18coroutine: add some preconditionsMarc-André Lureau1-4/+4
2013-01-21build-sys: missing sys/types.h in gtk/channel-display.cJasper Lievisse Adriaanse1-0/+2
2011-05-23define MAP_ANON as MAP_ANONYMOUS if neededAttila Sukosd1-0/+4
Mac OS X doesn't have MAP_ANONYMOUS, only MAP_ANON, so use MAP_ANON when MAP_ANONYMOUS isn't defined.
2010-12-05gtk: add coroutine utilitiesMarc-André Lureau1-0/+133