You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

90 lines
2.5 KiB

Added all changes from old 4.0 version: PSTACK, libmysqld and MySQL filesystem UPDATE ... ORDER BY DELETE ... ORDER BY New faster fulltext handling Faster compressed keys Makefile.am: Added support for pstack and libmysqld_dir acconfig.h: MySQL filesystem and PSTACK acinclude.m4: MySQL File system client/mysql.cc: Support for --xml configure.in: Pstack, MySQL FS and libmysqld_dir include/ft_global.h: Faster fulltext include/my_pthread.h: Made c++ safe include/myisam.h: Update for faster fulltext include/mysql_com.h: new my_net_read() include/violite.h: libmysqld libmysql/net.c: New protocol that supports big packets myisam/Makefile.am: Faster fulltext myisam/ft_parser.c: Faster fulltext myisam/ft_search.c: Faster fulltext myisam/ft_update.c: Faster fulltext myisam/ftdefs.h: Faster fulltext myisam/mi_check.c: Faster fulltext myisam/mi_open.c: Faster compressed keys myisam/mi_search.c: Faster compressed keys myisam/mi_update.c: Faster compressed keys myisam/myisamdef.h: Faster compressed keys myisam/sort.c: Faster compressed keys mysql-test/mysql-test-run.sh: --skip-innobase and --skip-bdb sql/ChangeLog: Changelog sql/Makefile.am: PSTACK sql/mysql_priv.h: New ORDER BY options and libmysqld sql/mysqld.cc: PSTACK sql/net_serv.cc: New protocol that supports big packets sql/share/estonian/errmsg.txt: New error messages sql/sql_base.cc: Better list_open_tabels sql/sql_delete.cc: ORDER BY for delete sql/sql_lex.cc: Added language convertation of all strings sql/sql_parse.cc: Changes for libmysqld Use new ORDER BY options sql/sql_show.cc: Character set convertations Use new list_open_tables function. sql/sql_update.cc: UPDATE ... ORDER BY sql/sql_yacc.yy: Clean up symbol definitions DELETE .. ORDER BY UPDATE .. ORDER BY sql/table.h: new OPEN_TABLE_LIST structure BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted
25 years ago
  1. /* $Header$ */
  2. /*
  3. * LinuxThreads specific stuff.
  4. */
  5. #include <sys/types.h>
  6. #include <assert.h>
  7. #include <limits.h> /* PTHREAD_THREADS_MAX */
  8. #include <pthread.h>
  9. #include <stdio.h>
  10. #include <unistd.h>
  11. #include <signal.h>
  12. #include <sched.h>
  13. #include "linuxthreads.h"
  14. #define AT_INT(intval) *((int32_t*)(intval))
  15. /*
  16. * Internal LinuxThreads variables.
  17. * Official interface exposed to GDB.
  18. */
  19. #if 1
  20. extern volatile int __pthread_threads_debug;
  21. extern volatile char __pthread_handles;
  22. extern char __pthread_initial_thread;
  23. /*extern volatile Elf32_Sym* __pthread_manager_thread;*/
  24. extern const int __pthread_sizeof_handle;
  25. extern const int __pthread_offsetof_descr;
  26. extern const int __pthread_offsetof_pid;
  27. extern volatile int __pthread_handles_num;
  28. #endif /* 0 */
  29. /*
  30. * Notify others.
  31. */
  32. int
  33. linuxthreads_notify_others( const int signotify)
  34. {
  35. const pid_t mypid = getpid();
  36. //const pthread_t mytid = pthread_self();
  37. int i;
  38. int threadcount = 0;
  39. int threads[PTHREAD_THREADS_MAX];
  40. int pid;
  41. TRACE_FPRINTF((stderr, "theadcount:%d\n", __pthread_handles_num));
  42. if (__pthread_handles_num==2) {
  43. /* no threads beside the initial thread */
  44. return 0;
  45. }
  46. /*assert(maxthreads>=3);
  47. assert(maxthreads>=__pthread_handles_num+2);*/
  48. // take the initial thread with us
  49. pid = AT_INT(&__pthread_initial_thread + __pthread_offsetof_pid);
  50. if (pid!=mypid && pid!=0)
  51. threads[threadcount++] = pid;
  52. // don't know why, but always handles[0]==handles[1]
  53. for (i=1; i<__pthread_handles_num; ++i) {
  54. const int descr = AT_INT(&__pthread_handles+i*__pthread_sizeof_handle+__pthread_offsetof_descr);
  55. assert(descr!=0);
  56. pid = AT_INT(descr+__pthread_offsetof_pid);
  57. if (pid!=mypid && pid!=0)
  58. threads[threadcount++] = pid;
  59. }
  60. /* TRACE_FPRINTF((stderr, "Stopping threads...")); */
  61. //for (i=0; i<threadcount; ++i) {
  62. // /* TRACE_FPRINTF((stderr, "%d ", threads[i])); */
  63. // fflush(stdout);
  64. // kill(threads[i], SIGSTOP); /* Tell thread to stop */
  65. //}
  66. /* TRACE_FPRINTF((stderr, " done!\n")); */
  67. for (i=0; i<threadcount; ++i) {
  68. TRACE_FPRINTF((stderr, "--- NOTIFYING %d\n", threads[i]));
  69. kill(threads[i], signotify); /* Tell to print stack trace */
  70. /* TRACE_FPRINTF((stderr, "--- WAITING FOR %d\n", threads[i])); */
  71. /*pause(); Wait for confirmation. */
  72. }
  73. for (i=0; i<threadcount; ++i)
  74. sched_yield();
  75. for (i=0; i<threadcount; ++i) {
  76. TRACE_FPRINTF((stderr, "--- KILLING %d\n", threads[i]));
  77. kill(threads[i], SIGKILL); /* Tell thread die :) */
  78. }
  79. return __pthread_handles_num;
  80. }