[Mono-dev] unifying eglib implementations in bluez & mono

Mike Frysinger vapier.adi at gmail.com
Wed Aug 12 21:59:19 EDT 2009


a recent google for a stripped down/embedded version of glib lead me
to two projects which seem to have been developed independently but
for the same exact purpose.  the bluez code has:
http://git.kernel.org/?p=bluetooth/eglib.git;a=summary
while the mono code has:
http://anonsvn.mono-project.com/viewvc/trunk/mono/eglib/

going by some of the info on the web, the bluez project doesnt really
have interest / manpower to keep the eglib code running (even though
there are users interested in keeping the functionality).  on the mono
side though, it appears the code is actively maintained and kept up to
date.  perhaps the functionality of the bluez version should be
reviewed and pushed to the mono one and then ultimately shutdown ?
after all, checking out and using just the eglibc code from mono seems
to be trivial.

on the mono side, is there interest in adding things that mono itself
may not use ?  for example, creating a small shim from the gthread api
to the pthread api looks fairly trivial ...

typedef pthread_t GThread;
static inline GThread *g_thread_create(GThreadFunc func, gpointer
data, gboolean joinable, GError **error)
{
    GThread *ret = g_malloc(sizeof(*ret));
    g_assert(joinable == TRUE);
    pthread_create(ret, NULL, func, data);
    return ret;
}
#define g_thread_exit(ret) pthread_exit(ret)
#define g_thread_self() pthread_self()
static inline gpointer g_thread_join(GThread *tid)
{
    void *ret;
    pthread_join(*tid, &ret);
    return ret;
}

same for the gmutex code:
typedef pthread_mutex_t GMutex;
#define g_mutex_new() g_malloc(sizeof(GMutex))
#define g_mutex_free(mutex) g_free(mutex)
#define g_mutex_lock(mutex) pthread_mutex_lock(mutex)
#define g_mutex_unlock(mutex) pthread_mutex_unlock(mutex)
-mike


More information about the Mono-devel-list mailing list