Diff of /testsuite/workloads/thread_src/thread.c [000000] .. [485655] Maximize Restore

  Switch to side-by-side view

--- a
+++ b/testsuite/workloads/thread_src/thread.c
@@ -0,0 +1,52 @@
+/* thread.c
+ *  Copyright (C) 2012 IBM
+
+ * This file is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include <stdio.h>
+#include <pthread.h>
+#include <stdlib.h>
+
+#define N     300
+
+void* mythread(void* arg)
+{
+	int i,j,k;
+	long c;
+
+	printf("Thread start!\n");
+	for(i=0; i< N; i++)
+	for(j=0; j< N; j++)
+	for(k=0; k< N; k++)
+		c=i+j+k;
+	printf("Thread done!\n");
+	return NULL;
+}
+int main()
+{
+	pthread_t th;
+
+	printf("main process start!\n");
+	if ( pthread_create(&th,NULL,mythread,NULL)!=0)
+	{
+		printf("can not create thread,exit!\n");
+		exit(0);
+	}
+	pthread_join(th, NULL);  /* wait for thread */
+
+	printf("main process done!\n");
+	return 0;
+}