|
Revision 3666
(checked in by jdapena, 6 months ago)
|
* Use GOnce registering all types in tinymail to make
registering thread-safe.
|
| Line | |
|---|
| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
#include <config.h> |
|---|
| 21 |
|
|---|
| 22 |
#include <tny-summary-view.h> |
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
static void |
|---|
| 26 |
tny_summary_view_base_init (gpointer g_class) |
|---|
| 27 |
{ |
|---|
| 28 |
static gboolean initialized = FALSE; |
|---|
| 29 |
|
|---|
| 30 |
if (!initialized) { |
|---|
| 31 |
|
|---|
| 32 |
initialized = TRUE; |
|---|
| 33 |
} |
|---|
| 34 |
} |
|---|
| 35 |
|
|---|
| 36 |
static gpointer |
|---|
| 37 |
tny_summary_view_register_type (gpointer notused) |
|---|
| 38 |
{ |
|---|
| 39 |
GType type = 0; |
|---|
| 40 |
|
|---|
| 41 |
static const GTypeInfo info = |
|---|
| 42 |
{ |
|---|
| 43 |
sizeof (TnySummaryViewIface), |
|---|
| 44 |
tny_summary_view_base_init, |
|---|
| 45 |
NULL, |
|---|
| 46 |
NULL, |
|---|
| 47 |
NULL, |
|---|
| 48 |
NULL, |
|---|
| 49 |
0, |
|---|
| 50 |
0, |
|---|
| 51 |
NULL |
|---|
| 52 |
}; |
|---|
| 53 |
type = g_type_register_static (G_TYPE_INTERFACE, |
|---|
| 54 |
"TnySummaryView", &info, 0); |
|---|
| 55 |
|
|---|
| 56 |
g_type_interface_add_prerequisite (type, G_TYPE_OBJECT); |
|---|
| 57 |
|
|---|
| 58 |
return GUINT_TO_POINTER (type); |
|---|
| 59 |
} |
|---|
| 60 |
|
|---|
| 61 |
GType |
|---|
| 62 |
tny_summary_view_get_type (void) |
|---|
| 63 |
{ |
|---|
| 64 |
static GOnce once = G_ONCE_INIT; |
|---|
| 65 |
g_once (&once, tny_summary_view_register_type, NULL); |
|---|
| 66 |
return GPOINTER_TO_UINT (once.retval); |
|---|
| 67 |
} |
|---|