summaryrefslogtreecommitdiff
path: root/debian/patches/introspection0009-fixup_libports.patch
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2015-09-25 23:08:53 +0200
committerJustus Winter <4winter@informatik.uni-hamburg.de>2015-09-25 23:08:53 +0200
commita285dec332ad1556cc0dc87636cb882a3b75b281 (patch)
tree0cee4988875773c5d9b7e14a3a3e7b07584f519b /debian/patches/introspection0009-fixup_libports.patch
parent86ec7a61430134c722f42ffa0b9f686f40854661 (diff)
drop old patch series
Diffstat (limited to 'debian/patches/introspection0009-fixup_libports.patch')
-rw-r--r--debian/patches/introspection0009-fixup_libports.patch122
1 files changed, 0 insertions, 122 deletions
diff --git a/debian/patches/introspection0009-fixup_libports.patch b/debian/patches/introspection0009-fixup_libports.patch
deleted file mode 100644
index 02afb676..00000000
--- a/debian/patches/introspection0009-fixup_libports.patch
+++ /dev/null
@@ -1,122 +0,0 @@
-From c899d36cf0358036428e0f545da0ea1bff812022 Mon Sep 17 00:00:00 2001
-From: Justus Winter <4winter@informatik.uni-hamburg.de>
-Date: Thu, 24 Sep 2015 18:23:28 +0200
-Subject: [PATCH hurd 09/11] fixup_libports
-
----
- libports/introspection.c | 35 ++++++++++++++++++++---------------
- libports/manage-multithread.c | 6 ++++--
- libports/manage-one-thread.c | 6 ++++--
- libports/ports.h | 1 +
- 4 files changed, 29 insertions(+), 19 deletions(-)
-
-diff --git a/libports/introspection.c b/libports/introspection.c
-index 912c768..07f8624 100644
---- a/libports/introspection.c
-+++ b/libports/introspection.c
-@@ -71,24 +71,29 @@ service_introspection_requests (void *arg)
- return NULL;
- }
-
--/* Start the introspection server before main is called. */
--static void __attribute__ ((constructor))
--init (void)
-+/* Start the introspection server if it is not already running. */
-+void
-+_ports_start_introspection_server (void)
- {
-+ static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
-+ static int initialized = 0;
- error_t err;
--
- pthread_t thread;
-- pthread_attr_t attr;
--#define STACK_SIZE (64 * 1024)
-- pthread_attr_init (&attr);
-- pthread_attr_setstacksize (&attr, STACK_SIZE);
--#undef STACK_SIZE
--
-- err = pthread_create (&thread, &attr,
-- service_introspection_requests, NULL);
-- if (err)
-- error (1, err, "pthread_create");
-- pthread_detach (thread);
-+
-+ pthread_mutex_lock (&lock);
-+ if (! initialized)
-+ {
-+ err = pthread_create (&thread, NULL,
-+ service_introspection_requests, NULL);
-+ if (err)
-+ error (0, err, "Error starting introspection server");
-+ else
-+ {
-+ pthread_detach (thread);
-+ initialized = 1;
-+ }
-+ }
-+ pthread_mutex_unlock (&lock);
- }
-
- /* Return the number of hard and weak references of the object
-diff --git a/libports/manage-multithread.c b/libports/manage-multithread.c
-index 8707d98..d2e7dbe 100644
---- a/libports/manage-multithread.c
-+++ b/libports/manage-multithread.c
-@@ -214,8 +214,7 @@ ports_manage_port_operations_multithread (struct port_bucket *bucket,
- }
- ports_port_deref (pi);
-
-- if (__builtin_expect (MACH_PORT_VALID (trace_port), 0)
-- && outp->RetCode != MIG_NO_REPLY)
-+ if (__builtin_expect (MACH_PORT_VALID (trace_port), 0))
- introspection_trace_message (trace_port, outp, trace_id);
- }
- else
-@@ -291,5 +290,8 @@ ports_manage_port_operations_multithread (struct port_bucket *bucket,
- master thread from going away. */
- global_timeout = 0;
-
-+ /* Make sure the introspection server is running. */
-+ _ports_start_introspection_server ();
-+
- thread_function ((void *) 1);
- }
-diff --git a/libports/manage-one-thread.c b/libports/manage-one-thread.c
-index 55aa378..86d575e 100644
---- a/libports/manage-one-thread.c
-+++ b/libports/manage-one-thread.c
-@@ -104,8 +104,7 @@ ports_manage_port_operations_one_thread (struct port_bucket *bucket,
- }
- ports_port_deref (pi);
-
-- if (__builtin_expect (MACH_PORT_VALID (trace_port), 0)
-- && outp->RetCode != MIG_NO_REPLY)
-+ if (__builtin_expect (MACH_PORT_VALID (trace_port), 0))
- introspection_trace_message (trace_port, outp, trace_id);
- }
- else
-@@ -125,6 +124,9 @@ ports_manage_port_operations_one_thread (struct port_bucket *bucket,
- zero. */
- timeout = 0;
-
-+ /* Make sure the introspection server is running. */
-+ _ports_start_introspection_server ();
-+
- _ports_thread_online (&bucket->threadpool, &thread);
- do
- err = mach_msg_server_timeout (internal_demuxer, 0, bucket->portset,
-diff --git a/libports/ports.h b/libports/ports.h
-index a31b894..e61b38c 100644
---- a/libports/ports.h
-+++ b/libports/ports.h
-@@ -496,5 +496,6 @@ void _ports_complete_deallocate (struct port_info *);
- error_t _ports_create_port_internal (struct port_class *, struct port_bucket *,
- size_t, void *, int);
- error_t _ports_trace_message (mach_port_t, const mach_msg_header_t *);
-+void _ports_start_introspection_server (void);
-
- #endif
---
-2.1.4
-