summaryrefslogtreecommitdiffstats
path: root/libmsi/table.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmsi/table.c')
-rw-r--r--libmsi/table.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libmsi/table.c b/libmsi/table.c
index 489d450..c8a284c 100644
--- a/libmsi/table.c
+++ b/libmsi/table.c
@@ -1868,10 +1868,10 @@ static unsigned table_view_add_ref(LibmsiView *view)
for (i = 0; i < tv->table->col_count; i++)
{
if (tv->table->colinfo[i].type & MSITYPE_TEMPORARY)
- InterlockedIncrement(&tv->table->colinfo[i].ref_count);
+ __sync_add_and_fetch(&tv->table->colinfo[i].ref_count, 1);
}
- return InterlockedIncrement(&tv->table->ref_count);
+ return __sync_add_and_fetch(&tv->table->ref_count, 1);
}
static unsigned table_view_remove_column(LibmsiView *view, const WCHAR *table, unsigned number)
@@ -1920,7 +1920,7 @@ static unsigned table_view_release(LibmsiView *view)
{
if (tv->table->colinfo[i].type & MSITYPE_TEMPORARY)
{
- ref = InterlockedDecrement(&tv->table->colinfo[i].ref_count);
+ ref = __sync_sub_and_fetch(&tv->table->colinfo[i].ref_count, 1);
if (ref == 0)
{
r = table_view_remove_column(view, tv->table->colinfo[i].tablename,
@@ -1931,7 +1931,7 @@ static unsigned table_view_release(LibmsiView *view)
}
}
- ref = InterlockedDecrement(&tv->table->ref_count);
+ ref = __sync_sub_and_fetch(&tv->table->ref_count, 1);
if (ref == 0)
{
if (!tv->table->row_count)
@@ -1976,7 +1976,7 @@ static unsigned table_view_add_column(LibmsiView *view, const WCHAR *table, unsi
{
if (!strcmpW( msitable->colinfo[i].colname, column ))
{
- InterlockedIncrement(&msitable->colinfo[i].ref_count);
+ __sync_add_and_fetch(&msitable->colinfo[i].ref_count, 1);
break;
}
}