summaryrefslogtreecommitdiffstats
path: root/libmsi/table.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-12-05 10:13:57 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2012-12-06 20:30:33 +0100
commit62e97279b098bfa48228051f02454809190f93d8 (patch)
treebfa3a16e2ecc1797fe16b85dda35cde8b338bc38 /libmsi/table.c
parentcd760049bab606856d310655a39d6ab7b37b6ff6 (diff)
downloadmsitools-62e97279b098bfa48228051f02454809190f93d8.tar.gz
msitools-62e97279b098bfa48228051f02454809190f93d8.tar.xz
msitools-62e97279b098bfa48228051f02454809190f93d8.zip
do not use InterlockedIncrement/Decrement
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;
}
}