fixed the io semaphore handling error when DEVPOLL is activated

This commit is contained in:
hyunghwan.chung 2017-06-27 13:47:58 +00:00
parent 6a721bb62a
commit 979040e7b3
5 changed files with 16 additions and 15 deletions

View File

@ -575,26 +575,33 @@ extend X11
class MyObject(Object)
{
var disp1, shell1, shell2.
var disp1, disp2, shell1, shell2, shell3.
method main1
{
self.disp1 := X11 new.
self.disp2 := X11 new.
shell1 := (X11.Shell new title: 'Shell 1').
shell2 := (X11.Shell new title: 'Shell 2').
shell3 := (X11.Shell new title: 'Shell 3').
shell1 x: 10; y: 20; width: 100; height: 100.
shell2 x: 200; y: 200; width: 200; height: 200.
shell3 x: 500; y: 200; width: 200; height: 200.
self.disp1 addShell: shell1.
self.disp1 addShell: shell2.
self.disp2 addShell: shell3.
self.shell1 add: (X11.Label new text: 'xxxxxxxx').
self.shell1 realize.
self.shell2 realize.
self.shell3 realize.
self.disp1 enterEventLoop. ## this is not a blocking call. it spawns another process.
self.disp2 enterEventLoop.
}
method(#class) main

View File

@ -790,6 +790,8 @@ static int _add_poll_fd (moo_t* moo, int fd, int event_mask, moo_oow_t event_dat
MOO_DEBUG2 (moo, "Cannot add file descriptor %d to devpoll - %hs\n", fd, strerror(errno));
return -1;
}
xtn->epd.ptr[fd] = event_data;
return 0;
#elif defined(USE_EPOLL)
@ -838,6 +840,7 @@ static int _add_poll_fd (moo_t* moo, int fd, int event_mask, moo_oow_t event_dat
xtn->ev.reg.ptr[xtn->ev.reg.len].revents = 0;
xtn->ev.reg.len++;
xtn->epd.ptr[fd] = event_data;
return 0;
#else

View File

@ -404,7 +404,7 @@ static_modtab[] =
{ "stdio", moo_mod_stdio },
#if defined(MOO_ENABLE_MOD_X11)
{ "x11", moo_mod_x11 },
{ "x11.win", moo_mod_x11_win },
/*{ "x11.win", moo_mod_x11_win },*/
#endif
};
#endif

View File

@ -70,7 +70,7 @@ libmoo_stdio_la_LDFLAGS = $(LDFLAGS_COMMON)
libmoo_stdio_la_LIBADD = $(LIBADD_COMMON)
if ENABLE_MOD_X11
libmoo_x11_la_SOURCES = x11.c x11-win.c _x11.h
libmoo_x11_la_SOURCES = x11.c _x11.h
libmoo_x11_la_CPPFLAGS = $(CPPFLAGS_COMMON)
libmoo_x11_la_LDFLAGS = $(LDFLAGS_COMMON)
libmoo_x11_la_LIBADD = $(LIBADD_COMMON) -lX11

View File

@ -182,9 +182,8 @@ libmoo_stdio_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
@ENABLE_STATIC_MODULE_TRUE@am_libmoo_stdio_la_rpath =
@ENABLE_MOD_X11_TRUE@libmoo_x11_la_DEPENDENCIES = \
@ENABLE_MOD_X11_TRUE@ $(am__DEPENDENCIES_1)
am__libmoo_x11_la_SOURCES_DIST = x11.c x11-win.c _x11.h
@ENABLE_MOD_X11_TRUE@am_libmoo_x11_la_OBJECTS = libmoo_x11_la-x11.lo \
@ENABLE_MOD_X11_TRUE@ libmoo_x11_la-x11-win.lo
am__libmoo_x11_la_SOURCES_DIST = x11.c _x11.h
@ENABLE_MOD_X11_TRUE@am_libmoo_x11_la_OBJECTS = libmoo_x11_la-x11.lo
libmoo_x11_la_OBJECTS = $(am_libmoo_x11_la_OBJECTS)
libmoo_x11_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
@ -455,7 +454,7 @@ libmoo_stdio_la_SOURCES = stdio.c _stdio.h
libmoo_stdio_la_CPPFLAGS = $(CPPFLAGS_COMMON)
libmoo_stdio_la_LDFLAGS = $(LDFLAGS_COMMON)
libmoo_stdio_la_LIBADD = $(LIBADD_COMMON)
@ENABLE_MOD_X11_TRUE@libmoo_x11_la_SOURCES = x11.c x11-win.c _x11.h
@ENABLE_MOD_X11_TRUE@libmoo_x11_la_SOURCES = x11.c _x11.h
@ENABLE_MOD_X11_TRUE@libmoo_x11_la_CPPFLAGS = $(CPPFLAGS_COMMON)
@ENABLE_MOD_X11_TRUE@libmoo_x11_la_LDFLAGS = $(LDFLAGS_COMMON)
@ENABLE_MOD_X11_TRUE@libmoo_x11_la_LIBADD = $(LIBADD_COMMON) -lX11
@ -560,7 +559,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmoo_console_la-console.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmoo_ffi_la-ffi.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmoo_stdio_la-stdio.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmoo_x11_la-x11-win.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmoo_x11_la-x11.Plo@am__quote@
.c.o:
@ -615,13 +613,6 @@ libmoo_x11_la-x11.lo: x11.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmoo_x11_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmoo_x11_la-x11.lo `test -f 'x11.c' || echo '$(srcdir)/'`x11.c
libmoo_x11_la-x11-win.lo: x11-win.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmoo_x11_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libmoo_x11_la-x11-win.lo -MD -MP -MF $(DEPDIR)/libmoo_x11_la-x11-win.Tpo -c -o libmoo_x11_la-x11-win.lo `test -f 'x11-win.c' || echo '$(srcdir)/'`x11-win.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmoo_x11_la-x11-win.Tpo $(DEPDIR)/libmoo_x11_la-x11-win.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='x11-win.c' object='libmoo_x11_la-x11-win.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmoo_x11_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libmoo_x11_la-x11-win.lo `test -f 'x11-win.c' || echo '$(srcdir)/'`x11-win.c
mostlyclean-libtool:
-rm -f *.lo