Skip to content

Commit

Permalink
[Fix] Highlight in C
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastienTainon committed May 22, 2024
1 parent 7c618a8 commit da30371
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 4 additions & 3 deletions frontend/stepper/abstract_runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,10 @@ export default abstract class AbstractRunner {
log.getLogger('multithread').debug('[multithread] default create new thread');
}

public registerNewThread(threadData: any): number {
log.getLogger('multithread').debug('[multithread] register new thread', threadData, threadData.length);
public registerNewThread(threadData: any = null): number {
log.getLogger('multithread').debug('[multithread] register new thread', threadData);
const newThreadId = this.maxThreadId;
this.threads[newThreadId] = [...threadData];
this.threads[newThreadId] = threadData ? [...threadData] : null;
this.maxThreadId++;

return newThreadId;
Expand Down Expand Up @@ -195,6 +195,7 @@ export default abstract class AbstractRunner {
}

public swapCurrentThreadId(newThreadId: number): void {
this.currentThreadId = newThreadId;
}

public currentThreadFinished(newThreadId: number): void {
Expand Down
2 changes: 2 additions & 0 deletions frontend/stepper/c/unix_runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ export default class UnixRunner extends AbstractRunner {
}

public async programInitialization(stepperContext: StepperContext): Promise<void> {
this.registerNewThread();

while (!inUserCode(stepperContext.state)) {
/* Mutate the stepper context to advance execution by a single step. */
const effects = C.step(stepperContext.state.programState);
Expand Down

0 comments on commit da30371

Please sign in to comment.