UnlockMutex Command

Description:

This command unlock a previously locked mutex (See LockMutex).

Format:

UNLOCKMUTEX mutexName;

Parameters:

mutexName

A string literal defining the mutex name.

Example:

String szUserId;
File sharedFile;

// Get the curent User Id
Load UserId Into szUserId;

// Open a file to log current User Id, this file is shared by all virtual users
Open "DataFile.txt" As sharedFile For Output;

// Lock a mutex to prevent other virtual users to write in the shared file at the same time
LockMutex "Mutex for sharedFile";

Write szUserId To sharedFile;
Write "\n" To sharedFile;

// Unlock the mutex to resume execution for other virtual users
UnlockMutex "Mutex for sharedFile";

Output File:

1-1
1-3
1-2
1-4
1-6
1-7
1-5
1-8
1-9
1-10





Go back to the Learning center:


Copyright © AgileLoad. All rights reserved.
Agile Load testing tool| Contact AgileLoad | Terms of Use | Sitemap