Ignore:
Timestamp:
Sep 5, 2008, 2:32:28 PM (12 years ago)
Author:
muks
Message:

(win32) Fix types and alignment in interlocked exchange

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/platform.c

    r6702 r6710  
    647647 */
    648648
     649static LONG volatile g_sl __attribute__ ((aligned (4)));
     650
    649651/* Wait for spin lock */
    650 static int slwait (int *sl) {
    651     while (InterlockedCompareExchange ((void **) sl, (void *) 1, (void *) 0) != 0)
     652static int slwait (LONG volatile *sl) {
     653    while (InterlockedCompareExchange (sl, 1, 0) != 0)
    652654        Sleep (0);
    653655    return 0;
     
    655657
    656658/* Release spin lock */
    657 static int slrelease (int *sl) {
     659static int slrelease (LONG *sl) {
    658660    InterlockedExchange (sl, 0);
    659661    return 0;
    660662}
    661 
    662 static int g_sl;
    663663
    664664void *mmap (void *ptr, long size, long prot, long type, long handle, long arg) {
Note: See TracChangeset for help on using the changeset viewer.