add spawn thread API and sample (#333)
This commit is contained in:
15
samples/spawn-thread/wasm-apps/sum.c
Normal file
15
samples/spawn-thread/wasm-apps/sum.c
Normal file
@ -0,0 +1,15 @@
|
||||
/*
|
||||
* Copyright (C) 2019 Intel Corporation. All rights reserved.
|
||||
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
*/
|
||||
|
||||
int sum(int start, int length)
|
||||
{
|
||||
int sum = 0, i;
|
||||
|
||||
for (i = start; i < start + length; i++) {
|
||||
sum += i;
|
||||
}
|
||||
|
||||
return sum;
|
||||
}
|
||||
Reference in New Issue
Block a user