Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Pryor <jpryor@novell.com>2010-04-15 21:31:24 +0400
committerJonathan Pryor <jpryor@novell.com>2010-04-15 21:31:24 +0400
commitcbc04e59b20d3bca51bf1c08a096b5542ccef164 (patch)
treedaf5b0d53b173048760a5ba554825cbd4d88f12b /support
parent69dc5906607a87ab9cb7364762e0c3e0830b5ba6 (diff)
* 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. svn path=/trunk/mono/; revision=155520
Diffstat (limited to 'support')
-rw-r--r--support/ChangeLog12
-rw-r--r--support/Makefile.am8
-rw-r--r--support/map.h3
-rw-r--r--support/signal.c12
4 files changed, 20 insertions, 15 deletions
diff --git a/support/ChangeLog b/support/ChangeLog
index 3979c66ef2d..a3e1e6d9c46 100644
--- a/support/ChangeLog
+++ b/support/ChangeLog
@@ -1,3 +1,15 @@
+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
diff --git a/support/Makefile.am b/support/Makefile.am
index a205ad9e663..fd7f1359dd1 100644
--- a/support/Makefile.am
+++ b/support/Makefile.am
@@ -103,18 +103,10 @@ libMonoPosixHelper_la_SOURCES = \
$(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
diff --git a/support/map.h b/support/map.h
index d35416392c9..a2e59fd9309 100644
--- a/support/map.h
+++ b/support/map.h
@@ -1401,6 +1401,7 @@ struct utimbuf;
* Delegate Declarations
*/
+typedef int (*Mono_Posix_RuntimeIsShuttingDown) (void);
/*
* Structures
@@ -1743,7 +1744,7 @@ int Mono_Posix_Syscall_WTERMSIG (int status);
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);
diff --git a/support/signal.c b/support/signal.c
index 11e60e1066e..6acb78977e6 100644
--- a/support/signal.c
+++ b/support/signal.c
@@ -155,7 +155,7 @@ static void release_mutex (pthread_mutex_t *mutex)
static inline int
keep_trying (int r)
{
- return r == -1 && errno == EINTR && !mono_runtime_is_shutting_down();
+ return r == -1 && errno == EINTR;
}
static void
@@ -333,7 +333,7 @@ teardown_pipes (signal_info** signals, int count)
}
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 {
@@ -345,7 +345,7 @@ wait_for_any (signal_info** signals, int count, int *currfd, struct pollfd* fd_s
ptv = &tv;
}
r = poll (fd_structs, count, timeout);
- } while (keep_trying (r));
+ } while (keep_trying (r) && !shutting_down ());
idx = -1;
if (r == 0)
@@ -359,7 +359,7 @@ wait_for_any (signal_info** signals, int count, int *currfd, struct pollfd* fd_s
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;
}
@@ -375,7 +375,7 @@ wait_for_any (signal_info** signals, int count, int *currfd, struct pollfd* fd_s
* 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;
@@ -394,7 +394,7 @@ Mono_Unix_UnixSignal_WaitAny (void** _signals, int count, int timeout /* millise
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)