Ejemplo n.º 1
0
        /*
        ** read_mutex_counters
        */
        static int test_read_mutex_counters(
            object clientdata,
            Tcl_Interp interp,
            int objc,
            Tcl_Obj[] objv
            )
        {
            Tcl_Obj pRet;
            int     ii;

            string[] aName = new string[] {
                "fast", "recursive", "static_master", "static_mem",
                "static_open", "static_prng", "static_lru", "static_pmem"
            };

            if (objc != 1)
            {
                TCL.Tcl_WrongNumArgs(interp, 1, objv, "");
                return(TCL.TCL_ERROR);
            }

            pRet = TCL.Tcl_NewObj();
            TCL.Tcl_IncrRefCount(pRet);
            for (ii = 0; ii < 8; ii++)
            {
                TCL.Tcl_ListObjAppendElement(interp, pRet, TCL.Tcl_NewStringObj(aName[ii], -1));
                TCL.Tcl_ListObjAppendElement(interp, pRet, TCL.Tcl_NewIntObj(g.aCounter[ii]));
            }
            TCL.Tcl_SetObjResult(interp, pRet);
            TCL.Tcl_DecrRefCount(ref pRet);

            return(TCL.TCL_OK);
        }