91 |
|
writer.SetAttribute(_B("xmlns:xsi"), _B("http://www.w3.org/2001/XMLSchema-instance")); |
92 |
|
writer.SetAttribute(_B("xsi:schemaLocation"), _B("http://www.google.com/schemas/sitemap/0.84 http://www.google.com/schemas/sitemap/0.84/sitemap.xsd")); |
93 |
|
|
94 |
< |
do |
95 |
< |
{ |
96 |
< |
Sleep(); |
97 |
< |
|
98 |
< |
_synchronized (queueLock) |
99 |
< |
while (queue.GetSize()) |
94 |
> |
_synchronized (queueLock) |
95 |
> |
do |
96 |
> |
_desynchronized (queueLock) |
97 |
|
{ |
98 |
< |
xml::ScopeElement url_(writer, _B("url")); |
99 |
< |
const Url &url(queue.Front()); |
98 |
> |
Sleep(); |
99 |
> |
|
100 |
> |
_synchronized (queueLock) |
101 |
> |
if (queue.GetSize()) |
102 |
> |
{ |
103 |
> |
xml::ScopeElement url_(writer, _B("url")); |
104 |
> |
const Url &url(queue.Front()); |
105 |
|
|
106 |
< |
{ |
107 |
< |
xml::ScopeElement loc(writer, _B("loc")); |
106 |
> |
{ |
107 |
> |
xml::ScopeElement loc(writer, _B("loc")); |
108 |
|
|
109 |
< |
writer.OutputText(url.GetLocation()); |
110 |
< |
} |
109 |
> |
writer.OutputText(url.GetLocation()); |
110 |
> |
} |
111 |
|
|
112 |
< |
{ |
113 |
< |
xml::ScopeElement lastmod(writer, _B("lastmod")); |
112 |
> |
{ |
113 |
> |
xml::ScopeElement lastmod(writer, _B("lastmod")); |
114 |
|
|
115 |
< |
writer.OutputText(url.GetModified()); |
116 |
< |
} |
115 |
> |
writer.OutputText(url.GetModified()); |
116 |
> |
} |
117 |
|
|
118 |
< |
{ |
119 |
< |
xml::ScopeElement changefreq(writer, _B("changefreq")); |
118 |
> |
{ |
119 |
> |
xml::ScopeElement changefreq(writer, _B("changefreq")); |
120 |
|
|
121 |
< |
writer.OutputText(url.GetFrequency()); |
122 |
< |
} |
121 |
> |
writer.OutputText(url.GetFrequency()); |
122 |
> |
} |
123 |
|
|
124 |
< |
{ |
125 |
< |
xml::ScopeElement priority(writer, _B("priority")); |
124 |
> |
{ |
125 |
> |
xml::ScopeElement priority(writer, _B("priority")); |
126 |
|
|
127 |
< |
writer.OutputText(url.GetPriority()); |
128 |
< |
} |
127 |
> |
writer.OutputText(url.GetPriority()); |
128 |
> |
} |
129 |
|
|
130 |
< |
queue.Pop(); |
131 |
< |
|
130 |
< |
_desynchronized (queueLock) |
131 |
< |
Sleep(); |
130 |
> |
queue.Pop(); |
131 |
> |
} |
132 |
|
} |
133 |
< |
} |
134 |
< |
while (working); |
133 |
> |
while (working || queue.GetSize()); |
134 |
|
|
135 |
|
return 0; |
136 |
|
} |