| 936 | } |
| 937 | |
| 938 | void SMS :: assignStart(long offset, int c) |
| 939 | { |
| 940 | bAssignDone[c] = false; |
| 941 | #ifdef MULTITHREADED |
| 942 | pthread_mutex_lock(&sliceMutex[c]); |
| 943 | #endif |
| 944 | sliceM0[c] = sliceBuffer[c].read(sliceBuffer[c].readPos+offset); |
| 945 | sliceM1[c] = sliceBuffer[c].read(sliceBuffer[c].readPos+offset+1); |
| 946 | if(res == 2) { |
| 947 | sliceM2[c] = sliceBuffer[c].read(sliceBuffer[c].readPos+offset+2); |
| 948 | } else { |
| 949 | sliceM2[c] = NULL; |
| 950 | } |
| 951 | #ifdef MULTITHREADED |
| 952 | pthread_mutex_unlock(&sliceMutex[c]); |
| 953 | #endif |
| 954 | for(TrackPoint *tp = sliceM0[c]->bottom; |
| 955 | tp; |
| 956 | tp = tp->pn) { |
| 957 | if(!tp->owner->bEnded) { |
| 958 | tp->owner->bEnd = true; |
| 959 | tp->bConnected = false; |
| 960 | tp->bOwned = false; |
| 961 | } else { |
| 962 | tp->bConnected = true; |
| 963 | tp->bOwned = true; |
| 964 | } |
| 965 | } |
| 966 | #ifdef MULTITHREADED |
| 967 | if(hi) pthread_mutex_lock(&hi->sliceMutex[c]); |
| 968 | #endif |
| 969 | sliceH0[c] = hi?hi->sliceBuffer[c].read(hi->sliceBuffer[c].readPos+(offset+1)*hi->res):NULL; |
| 970 | sliceH0[c] = NULL; |
| 971 | sliceH1[c] = hi?hi->sliceBuffer[c].read(hi->sliceBuffer[c].readPos+(offset+1)*hi->res):NULL; |
| 972 | #ifdef MULTITHREADED |
| 973 | if(hi) pthread_mutex_unlock(&hi->sliceMutex[c]); |
| 974 | #endif |
| 975 | #ifdef MULTITHREADED |
| 976 | if(lo) pthread_mutex_lock(&lo->sliceMutex[c]); |
| 977 | #endif |
| 978 | sliceL0[c] = lo?lo->sliceBuffer[c].read(lo->sliceBuffer[c].readPos+offset/res+1):NULL; |
| 979 | sliceL0[c] = NULL; |
| 980 | sliceL1[c] = lo?lo->sliceBuffer[c].read(lo->sliceBuffer[c].readPos+offset/res+1):NULL; |
| 981 | #ifdef MULTITHREADED |
| 982 | if(lo) pthread_mutex_unlock(&lo->sliceMutex[c]); |
| 983 | #endif |
| 984 | } |
| 985 | |
| 986 | void SMS :: assignInit(long offset, int c) |
| 987 | { |