+2010-04-15 Jonathan Pryor <jpryor@novell.com>
+
+ * Makefile.am: Revert previous linkage against libmono.so, as lupus
+ mentioned that it's unacceptable for MonoPosixHelper to link against
+ libmono (e.g. when embedding mono, there might not be a libmono).
+ * map.h: Flush updated Mono_Unix_UnixSignal_SignalInfo prototype.
+ * signal.c: Don't use mono_runtime_is_shutting_down(). Instead, change
+ Mono_Unix_UnixSignal_WaitAny() to accept a function pointer argument,
+ which will return Environment.HasShutdownStarted in managed code (the
+ moral equivalent of mono_runtime_is_shutting_down()). This allows
+ us to avoid a libmono dependency w/o lots of rewriting. Fixes #592981.
+
2010-04-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
* zlib-helper.c: now that we don't use Z_SYNC_FLUSH, there might be
$(Z_SOURCE) \
$(MINIZIP_SOURCE)
-if HOST_WIN32
libMonoPosixHelper_la_LIBADD = \
$(MPH_LIBS) \
$(Z_LIBS) \
$(XATTR_LIB)
-else
-libMonoPosixHelper_la_LIBADD = \
- ../mono/mini/libmono-2.0.la \
- $(MPH_LIBS) \
- $(Z_LIBS) \
- $(XATTR_LIB)
-endif
# libMonoPosixHelper_la_LDFLAGS = -no-undefined -version-info 1:0:1
libMonoPosixHelper_la_LDFLAGS = -no-undefined -avoid-version
* Delegate Declarations
*/
+typedef int (*Mono_Posix_RuntimeIsShuttingDown) (void);
/*
* Structures
int Mono_Posix_ToStatvfs (void* source, struct Mono_Posix_Statvfs* destination);
void* Mono_Unix_UnixSignal_install (int signum);
int Mono_Unix_UnixSignal_uninstall (void* info);
-int Mono_Unix_UnixSignal_WaitAny (void** infos, int count, int timeout);
+int Mono_Unix_UnixSignal_WaitAny (void** infos, int count, int timeout, Mono_Posix_RuntimeIsShuttingDown shutting_down);
int wexitstatus (int status);
int wifexited (int status);
int wifsignaled (int status);
static inline int
keep_trying (int r)
{
- return r == -1 && errno == EINTR && !mono_runtime_is_shutting_down();
+ return r == -1 && errno == EINTR;
}
static void
}
static int
-wait_for_any (signal_info** signals, int count, int *currfd, struct pollfd* fd_structs, int timeout)
+wait_for_any (signal_info** signals, int count, int *currfd, struct pollfd* fd_structs, int timeout, Mono_Posix_RuntimeIsShuttingDown shutting_down)
{
int r, idx;
do {
ptv = &tv;
}
r = poll (fd_structs, count, timeout);
- } while (keep_trying (r));
+ } while (keep_trying (r) && !shutting_down ());
idx = -1;
if (r == 0)
char c;
do {
r = read (h->read_fd, &c, 1);
- } while (keep_trying (r));
+ } while (keep_trying (r) && !shutting_down ());
if (idx == -1)
idx = i;
}
* index into _signals array of signal that was generated on success
*/
int
-Mono_Unix_UnixSignal_WaitAny (void** _signals, int count, int timeout /* milliseconds */)
+Mono_Unix_UnixSignal_WaitAny (void** _signals, int count, int timeout /* milliseconds */, Mono_Posix_RuntimeIsShuttingDown shutting_down)
{
int r;
int currfd = 0;
release_mutex (&signals_mutex);
if (r == 0) {
- r = wait_for_any (signals, count, &currfd, &fd_structs[0], timeout);
+ r = wait_for_any (signals, count, &currfd, &fd_structs[0], timeout, shutting_down);
}
if (acquire_mutex (&signals_mutex) == -1)