summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTomek CEDRO <cederom@tlen.pl>2011-06-16 07:09:41 +0000
committerTomek CEDRO <cederom@tlen.pl>2011-06-16 07:09:41 +0000
commit37eeba8e0473b961b20c7a305a251515b241a34c (patch)
tree4d3d617b01b88c0859ad5eceb0192abdca992b57 /src
parent1574a4f2a11c9169e96acc9c503eaa25e0113d11 (diff)
downloadopenocd+libswd-37eeba8e0473b961b20c7a305a251515b241a34c.tar.gz
openocd+libswd-37eeba8e0473b961b20c7a305a251515b241a34c.tar.bz2
openocd+libswd-37eeba8e0473b961b20c7a305a251515b241a34c.tar.xz
openocd+libswd-37eeba8e0473b961b20c7a305a251515b241a34c.zip
OPENOCD: Renamed ambiguous main2() into openocd_thread() to show possible solution for thread support in future.
Diffstat (limited to 'src')
-rw-r--r--src/openocd.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/openocd.c b/src/openocd.c
index f18c2432..317743dd 100644
--- a/src/openocd.c
+++ b/src/openocd.c
@@ -302,7 +302,11 @@ struct command_context *setup_command_handler(Jim_Interp *interp)
return cmd_ctx;
}
-static int main2(int argc, char *argv[], struct command_context *cmd_ctx)
+/** OpenOCD runtime meat that can become single-thread in future. It parse
+ * commandline, reads configuration, sets up the target and starts server loop.
+ * Commandline arguments are passed into this function from openocd_main().
+ */
+static int openocd_thread(int argc, char *argv[], struct command_context *cmd_ctx)
{
int ret;
@@ -363,7 +367,8 @@ int openocd_main(int argc, char *argv[])
command_context_mode(cmd_ctx, COMMAND_CONFIG);
command_set_output_handler(cmd_ctx, configuration_output_handler, NULL);
- ret = main2(argc, argv, cmd_ctx);
+ /* Start the executable meat that can evolve into thread in future. */
+ ret = openocd_thread(argc, argv, cmd_ctx);
unregister_all_commands(cmd_ctx, NULL);