Web lists-archives.com

Pthread lock on g_once_init_enter (&g_define_type_id__volatile)




Hello,

Maybe someone here can help me. I defined a subclass of another existing class.

Basicly:

typedef struct _ThriftSSLSocket ThriftSSLSocket;

struct _ThriftSSLSocket
{
  ThriftSocket parent;

  /* private */
};
typedef struct _ThriftSSLSocketClass ThriftSSLSocketClass;

struct _ThriftSSLSocketClass
{
    ThriftSocketClass parent;
};
// More code here


And in the C file I'm defining this new type:

G_DEFINE_TYPE(ThriftSSLSocket, thrift_ssl_socket, THRIFT_TYPE_SSL_SOCKET)

// More code here




Looks good sofar. But when I do:

  object = g_object_new (THRIFT_TYPE_SSL_SOCKET, NULL);


It stalls waiting for the macro expansion here:


  static volatile gsize g_define_type_id__volatile = 0;
    if (g_once_init_enter (&g_define_type_id__volatile)) {   <<<<<----------- Because a thread lock.
        GType g_define_type_id =



The question is why? Maybe the base class is not derivable?


Best regards,
_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
https://mail.gnome.org/mailman/listinfo/gtk-list