shm lock free

This commit is contained in:
luwenpeng
2023-06-26 18:05:38 +08:00
parent 74991f842a
commit bf3a1f09fb
6 changed files with 282 additions and 262 deletions

View File

@@ -8,6 +8,7 @@ static void usage(char *cmd)
{
fprintf(stderr, "USAGE: %s [OPTIONS]\n", cmd);
fprintf(stderr, " -f -- set feature id\n");
fprintf(stderr, " -n -- set thread number\n");
fprintf(stderr, " -h -- show help\n");
}
@@ -15,14 +16,18 @@ int main(int argc, char **argv)
{
int opt;
uint64_t feature_id = 0;
uint64_t thread_number = 1;
while ((opt = getopt(argc, argv, "f:h")) != -1)
while ((opt = getopt(argc, argv, "f:n:h")) != -1)
{
switch (opt)
{
case 'f':
feature_id = atoi(optarg);
break;
case 'n':
thread_number = atoi(optarg);
break;
case 'h': /* fall through */
default:
usage(argv[0]);
@@ -30,7 +35,10 @@ int main(int argc, char **argv)
}
}
hasp_verify(feature_id);
for (int i = 0; i < thread_number; i++)
{
hasp_verify(feature_id);
}
while (1)
{