VirtualBox

Changeset 43879 in vbox for trunk/src/VBox/Runtime/testcase


Ignore:
Timestamp:
Nov 15, 2012 2:49:23 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
82091
Message:

Extended RTOnce with termination cleanups. (Changes existing structures and functions.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/testcase/tstOnce.cpp

    r38636 r43879  
    4949
    5050
    51 static DECLCALLBACK(int) Once1CB(void *pvUser1, void *pvUser2)
     51static DECLCALLBACK(int) Once1CB(void *pvUser)
    5252{
    5353    if (g_fOnceCB1)
    5454        return VERR_WRONG_ORDER;
    55     if (pvUser1 != (void *)1 || pvUser2 != (void *)42)
     55    if (pvUser != (void *)1)
    5656    {
    57         RTPrintf("tstOnce: ERROR - Once1CB: pvUser1=%p pvUser2=%p!\n", pvUser1, pvUser2);
     57        RTPrintf("tstOnce: ERROR - Once1CB: pvUser=%p!\n", pvUser);
    5858        g_cErrors++;
    5959        return VERR_INVALID_PARAMETER;
     
    6363
    6464
    65 static DECLCALLBACK(int) Once2CB(void *pvUser1, void *pvUser2)
     65static DECLCALLBACK(int) Once2CB(void *pvUser)
    6666{
    6767    if (ASMAtomicIncU32(&g_cOnce2CB) != 1)
     
    7171        return VERR_WRONG_ORDER;
    7272    }
    73     if (pvUser1 != (void *)42 || pvUser2 != (void *)1)
     73    if (pvUser != (void *)42)
    7474    {
    75         RTPrintf("tstOnce: ERROR - Once2CB: pvUser1=%p pvUser2=%p!\n", pvUser1, pvUser2);
     75        RTPrintf("tstOnce: ERROR - Once2CB: pvUser=%p!\n", pvUser);
    7676        g_cErrors++;
    7777        return VERR_INVALID_PARAMETER;
     
    9090    if (RT_FAILURE(rc))
    9191        return rc;
    92     rc = RTOnce(&g_Once2, Once2CB, (void *)42, (void *)1);
     92    rc = RTOnce(&g_Once2, Once2CB, (void *)42);
    9393    if (RT_SUCCESS(rc))
    9494    {
     
    113113    RTONCE Once1 = RTONCE_INITIALIZER;
    114114    g_fOnceCB1 = false;
    115     int rc = RTOnce(&Once1, Once1CB, (void *)1, (void *)42);
     115    int rc = RTOnce(&Once1, Once1CB, (void *)1);
    116116    if (rc != VINF_SUCCESS)
    117117        RTPrintf("tstOnce: ERROR - Once1, 1 failed, rc=%Rrc\n", rc);
    118118    g_fOnceCB1 = false;
    119     rc = RTOnce(&Once1, Once1CB, (void *)1, (void *)42);
     119    rc = RTOnce(&Once1, Once1CB, (void *)1);
    120120    if (rc != VINF_SUCCESS)
    121121        RTPrintf("tstOnce: ERROR - Once1, 2 failed, rc=%Rrc\n", rc);
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette