Subversion Repositories HelenOS

Rev

Rev 2029 | Rev 2050 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2029 Rev 2042
Line 128... Line 128...
128
    printf("sp=%#x, readers_in=%d\n", ctx.sp, rwlock.readers_in);
128
    printf("sp=%#x, readers_in=%d\n", ctx.sp, rwlock.readers_in);
129
   
129
   
130
    k = random(7) + 1;
130
    k = random(7) + 1;
131
    printf("Creating %d readers\n", k);
131
    printf("Creating %d readers\n", k);
132
    for (i = 0; i < k; i++) {
132
    for (i = 0; i < k; i++) {
133
        thrd = thread_create(reader, NULL, TASK, 0, "reader");
133
        thrd = thread_create(reader, NULL, TASK, 0, "reader", false);
134
        if (thrd)
134
        if (thrd)
135
            thread_ready(thrd);
135
            thread_ready(thrd);
136
        else
136
        else
137
            printf("Could not create reader %d\n", i);
137
            printf("Could not create reader %d\n", i);
138
    }
138
    }
139
 
139
 
140
    k = random(5) + 1;
140
    k = random(5) + 1;
141
    printf("Creating %d writers\n", k);
141
    printf("Creating %d writers\n", k);
142
    for (i = 0; i < k; i++) {
142
    for (i = 0; i < k; i++) {
143
        thrd = thread_create(writer, NULL, TASK, 0, "writer");
143
        thrd = thread_create(writer, NULL, TASK, 0, "writer", false);
144
        if (thrd)
144
        if (thrd)
145
            thread_ready(thrd);
145
            thread_ready(thrd);
146
        else
146
        else
147
            printf("Could not create writer %d\n", i);
147
            printf("Could not create writer %d\n", i);
148
    }
148
    }